This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50606] gcc fails to detect obvious use of NULL pointer
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 May 2012 18:24:44 +0000
- Subject: [Bug c/50606] gcc fails to detect obvious use of NULL pointer
- Auto-submitted: auto-generated
- References: <bug-50606-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50606
--- Comment #2 from dcb <dcb314 at hotmail dot com> 2012-05-14 18:24:44 UTC ---
(In reply to comment #1)
> printf warnings are handled in the FE, so we would need constant-propagation in
> the FE. Clang implements it, so I know it is possible.
I think my bug report wasn't clearly worded.
printf was merely an example function.
I am interested in having gcc track when it knows
for certain that a pointer is NULL, so that it
can detect uses that won't work and emit a warning.
One use of a NULL pointer that won't work is to read
what it's pointing at.
> However, no current
> contributor to GCC has enough time and interest to implement it, so unless some
> new contributors appear, don't expect this anytime soon.
Righto.