This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16351] NULL dereference warnings
- From: "walles at mailblocks dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Dec 2004 12:04:45 -0000
- Subject: [Bug c/16351] NULL dereference warnings
- References: <20040703171719.16351.phython@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From walles at mailblocks dot com 2004-12-07 12:04 -------
Bug 18854 deals with *potential* NULL pointer dereferences, while this one
mentions only *confirmed* NULL pointer dereferences, i.e:
1 #include <stdlib.h>
2 int main(int argc, char *argv[]) {
3 volatile char *monkey = (char*)malloc(1234);
4 monkey[0] = '\0';
5 return 0;
6 }
Since malloc() on line 3 can *potentially* return NULL, I'd like a warning on
line 4.
Phython, would you say potential NULL dereferences are within the scope of this
bug, or should bug 18854 be re-opened for those cases?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16351