This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86177] Wnull-dereference warning for object file compile missing
- From: "jg at jguk dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 17 Jun 2018 08:37:22 +0000
- Subject: [Bug c++/86177] Wnull-dereference warning for object file compile missing
- Auto-submitted: auto-generated
- References: <bug-86177-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86177
--- Comment #6 from Jonny Grant <jg at jguk dot org> ---
Jonathan, This is a good point. Where is best to document it?
It's very useful to have these warnings, and I was unaware that -Wall would not
turn on such a necessary feature, or -O2
Could there be overall documentation on some default warning options that give
most useful warnings for safe code development?
BTW, I do feel the function could be warned when compiled as an object.
void f(int *i)
{
*i = 1;
}
There is an implied requirement that the pointer is never null.