This is the mail archive of the
mailing list for the GCC project.
Re: Optimization of conditional access to globals: thread-unsafe?
Darryl Miles wrote:
This then leads into the question. Is a pointer allowed to be invalid.
I'm sure I have read a comment on this before, along the line of the
spec says it must be valid or a certain number of other values (like
zero or one past being valid). But I can not cite chapter and verse if
this is true.
Well most certainly it can be null, and the code sequence in question
could just be testing a pointer for being null, that's certainly very
common code, and in fact I don't see why this won't cause trouble???