This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Chris Lattner <clattner@apple.com> writes:
On Jan 27, 2009, at 1:10 PM, Ian Lance Taylor wrote:
Laurent GUERBY <laurent@guerby.net> writes:
Just curious: is there a "portable" way to read from memory address zero in C code? "portable" here means likely to work on most compilers without exotic compile flags in 2009.
char *my_null_pointer; char fn() { return *my_null_pointer; }
It will be quite a while before whole program optimization is good enough to prove that my_null_pointer is not referenced by anything else.
Perhaps in GCC, but this is not a good solution if you care about other compilers.
Is LLVM smart enough to optimize that away, even when using shared libraries?
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |