This is the mail archive of the gcc-bugs@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]

[Bug c/22485] pointer +- integer is never NULL


------- Additional Comments From mattias at virtutech dot se  2005-07-15 09:12 -------
It could be made an option so the user can tell GCC whether to make
standard-conforming code go as fast as possible or if arithmetic on null
pointers (as a gcc extension, say) is needed. -fnull-pointer-arith?

(In reply to comment #13)
> Scanning a region of memory starting from zero, is not
> exactly the kind of thing never done in practice.

True, but that sort of code is already in danger, since GCC assumes that in

      x = *p;
      if (!p) shout();

the condition is never true (even if it is possible to read from location 0).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22485


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]