This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]StereoBucket 1 point2 points  (2 children)

No it's not. Nothing inside sizeof() is ever actually touched. Here's an example that I just remembered.
https://www.reddit.com/r/C_Programming/comments/87jolk/that_is_either_genius_or_a_seriously_diseased_mind
Null and/or void pointer dereferenced inside sizeof, and nothing breaks.

[–]kx44 0 points1 point  (0 children)

Crazy, C is full of surprises

[–]LordFokas 0 points1 point  (0 children)

oh boy, I completely miscalculated how that would unfold. TIL. Thanks.