https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #15 from Jakub Jelinek ---
Yes, that -Wjump-misses-init or -Wc++-compat.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #14 from Karine EM ---
I did compile it that way:
> gcc-10 -w -O2 r.c -pedantic -Wall -Wextra
but got no warnings at all. Should I add any flag?
Thanks!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #13 from Jakub Jelinek ---
Then -Wjump-misses-init should warn even on the unreduced testcase...
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #12 from Karine EM ---
Yes, I could do that (comment #7). But I reduce manually the program and the
problem was indeed the scenario in comment #8 (not between functions, only
different blocks, but I assume it is pretty much the same).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #11 from Jakub Jelinek ---
The reason why C++ has it as hard error is I think object
construction/destruction, in C the warning is for code to be portable to C++,
in plain C it is all about making sure variables are initialized, which
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #10 from Jakub Jelinek ---
Maybe, but I think it is too late to do it now for GCC 11, it will take time
before we figure out how many projects will be affected by that.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #9 from Richard Biener ---
Given we now place CLOBBERS at scope ends even for C code (which is why we
"miscompile" the reduced testcase) doesn't it make sense to at least include
-Wjump-misses-init into -W[extra] or even -Wall?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #8 from Jakub Jelinek ---
For goto crossing initialization, C++ makes it a hard error and C only has a
non-default warning (not even in -W), -Wjump-misses-init included in
-Wc++-compat.
As can be seen on:
int
foo (void)
{
goto a;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #7
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #6 from Karine EM ---
Created attachment 49945
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49945&action=edit
Original large code that caused Seg-fault in GCC-10
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
--- Comment #5 from Karine EM ---
This is an automatically reduced program. If GCC will give the Wuninitialized
warning I can reduce the original program again, taking it into account.
I attached the long program in case you find it helpful. It
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630
Richard Biener changed:
What|Removed |Added
Status|RESOLVED|NEW
Assignee|rguenth at gcc d
12 matches
Mail list logo