Vasiliy Tereshkov
Vasiliy Tereshkov
@ske2004 How can I reproduce it?
@ske2004 Yes, you'll get as many 0's as there were 0x0D's removed when converting line endings. Then it will return the EOF error. If it's a practical concern, I perhaps...
@ske2004 It is: https://learn.microsoft.com/en-us/cpp/c-runtime-library/text-and-binary-mode-file-i-o?view=msvc-170 https://www.quora.com/How-do-you-read-from-a-binary-stream-from-stdin-in-C
@ske2004 I remember we discussed the codepage, but not the opening mode. I doubt how `scanf()` will work if we open `stdin` as `"rb"`.
Partially covered by #539.
In expressions: ``` type P = struct { x: int } fn foo(p: ^^P): P { v := p^^ p^ = null return v } fn main() { p :=...
In built-in function calls: ``` var a: ^[]int fn foo(): int { a = null return 0 } fn main() { a = new([]int) b := slice(a^, foo()) // Crash!...
In indexing: ``` var p: ^[2]int fn foo(): int { p = null return 0 } fn main() { p = new([2]int) p[foo()] = 666 // Crash! printf("OK\n") } ```
@marekmaskarinec Short answer: yes. To be honest, I don't know how these examples should behave. None of them is sane Umka code. They should either silently produce meaningless results (i.e....
All these examples produce a nil pointer runtime error in Go. It's curious that even some more straightforward examples that seem to be correct still fail: https://go.dev/play/p/xEO_oAc3k4- According to the...