Timeline for Why would accessing uninitialized memory necessarily be undefined behavior?
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 8, 2023 at 19:59 | comment | added | supercat |
@Brian: The test2() function was supposed to be calling test1() . Code has been corrected. The split between test1() and test2() was intended to make the point that a compiler processing code test1() may have no way of knowing what if anything downstream code would be doing with x and y , and the purpose of using fwrite was that it should be capable of writing without weird side effects any bit pattern that might be stored at the source address, and a compiler would have no way of knowing whether anything in the universe would care about the contents of any particular byte.
|
|
Sep 8, 2023 at 19:55 | history | edited | supercat | CC BY-SA 4.0 |
added 1 character in body
|
Sep 8, 2023 at 19:53 | comment | added | Brian |
I see a definition for test1 and for test2 , but no definition for test , which is called by test2 . Am I missing something?
|
|
Sep 7, 2023 at 20:03 | history | answered | supercat | CC BY-SA 4.0 |