[Bug c++/86177] Wnull-dereference warning for object file compile missing

2021-08-13 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86177 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org --- Comment

[Bug c++/86177] Wnull-dereference warning for object file compile missing

2018-06-18 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86177 --- Comment #7 from Jonathan Wakely --- Lots of functions have such requirements and make it the caller's responsibility to meet those requirements. GCC is not a static analyser, you can't expect warnings about every possible bug in your code.

[Bug c++/86177] Wnull-dereference warning for object file compile missing

2018-06-17 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86177 --- Comment #6 from Jonny Grant --- 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 doc

[Bug c++/86177] Wnull-dereference warning for object file compile missing

2018-06-16 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86177 --- Comment #5 from Jonathan Wakely --- Why add it there and not to every other warning option that depends on interprocedural analysis and inlining? If the dereference and the null pointer are in separate files, then of course the compiler can'

[Bug c++/86177] Wnull-dereference warning for object file compile missing

2018-06-16 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86177 --- Comment #4 from Jonny Grant --- Thank you for your replies! Could the -flto tip be added to the -Wnull-dereference documentation? https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

[Bug c++/86177] Wnull-dereference warning for object file compile missing

2018-06-16 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86177 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/86177] Wnull-dereference warning for object file compile missing

2018-06-16 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86177 --- Comment #2 from Jonathan Wakely --- That's how C++ works. Each translation unit is compiled separately. It's your job to prevent such errors.

[Bug c++/86177] Wnull-dereference warning for object file compile missing

2018-06-16 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86177 --- Comment #1 from Jonny Grant --- If g++ compiles both main.cpp and main2.cpp at the same time (ie no separate obj file stage) it also doesn't give the expected warning. jonny@asus:~/code$ g++-8 -O2 -Wall -Wextra -Wnull-dereference -Wpedantic