https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #21 from Harald van Dijk ---
(In reply to Segher Boessenkool from comment #20)
> That is still not what I said, so don't pretend I did please.
>
> Those are also not false positives: in all these cases, the program does
> in fact
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #20 from Segher Boessenkool ---
That is still not what I said, so don't pretend I did please.
Those are also not false positives: in all these cases, the program does
in fact skip some initialisation.
But, it seems
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #19 from Harald van Dijk ---
(In reply to Segher Boessenkool from comment #18)
> (In reply to Harald van Dijk from comment #15)
> > (In reply to Segher Boessenkool from comment #10)
> > > The initialisation (the call to f1) could
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #18 from Segher Boessenkool ---
(In reply to Harald van Dijk from comment #15)
> (In reply to Segher Boessenkool from comment #10)
> > The initialisation (the call to f1) could have a side effect, but the
> > a==1 case skips that.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #17 from Harald van Dijk ---
(In reply to Steinar H. Gunderson from comment #16)
> Since you're asking (presumably rhethorically): I would certainly recommend
> that this code be changed, yes, and I don't find the author's intent
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #16 from Steinar H. Gunderson ---
Since you're asking (presumably rhethorically): I would certainly recommend
that this code be changed, yes, and I don't find the author's intent obvious at
all. The fix that comes to mind is to scope
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #15 from Harald van Dijk ---
(In reply to Segher Boessenkool from comment #10)
> The initialisation (the call to f1) could have a side effect, but the
> a==1 case skips that. GCC is right to warn here in my opinion.
With an
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #14 from Segher Boessenkool ---
I am saying that no warning should warn for things that are valid C but
invalid C++, except with -Wc++-compat; not for that reason, anyway.
-Wjump-misses-init should warn here: the jump does miss the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #13 from Steinar H. Gunderson ---
That could be (I disagree, but that's another debate), but the question was
whether allowing this case would improve the warning or not. If you change it
to allowing such a case, you also make
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #12 from Segher Boessenkool ---
That is not a reason to have the warning in C, not without some "-Wc++-compat"
or similar; and in C++ it should be an error you say, not a warning at all.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #11 from Steinar H. Gunderson ---
It is also not legal (side effects or not) when compiling as C++, which is one
of the reasons for having this warning.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #10 from Segher Boessenkool ---
The initialisation (the call to f1) could have a side effect, but the
a==1 case skips that. GCC is right to warn here in my opinion.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
Harald van Dijk changed:
What|Removed |Added
CC||harald at gigawatt dot nl
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
Segher Boessenkool changed:
What|Removed |Added
CC||segher at gcc dot gnu.org
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
Eric Gallager changed:
What|Removed |Added
Blocks||87656
--- Comment #7 from Eric Gallager
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #5 from Richard Biener ---
I think even -Wall makes sense.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #4 from Steinar H. Gunderson ---
Oh, it exists? Yes, if so, please count this as a request for enabling on
-Wextra.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #3 from joseph at codesourcery dot com ---
This is Wjump-misses-init. Is this a request to make some other option
such as -Wall or -Wextra enable that option (rather than just -Wc++-compat
as at present)?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
--- Comment #2 from Jonathan Wakely ---
And for the goto case Clang says:
87038.c:2:13: warning: variable 'foo' is used uninitialized whenever 'if'
condition is true [-Wsometimes-uninitialized]
if (x == 0) goto lbl;
^~
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87038
Jonathan Wakely changed:
What|Removed |Added
Keywords||diagnostic
21 matches
Mail list logo