This is the mail archive of the
mailing list for the GCC project.
Re: PATCH RFA: Add new warning for jump across initialized variable
"Joseph S. Myers" <firstname.lastname@example.org> writes:
> On Wed, 10 Jun 2009, Ian Lance Taylor wrote:
>> This patch adds a new warning to the C frontend: -Wgoto-misses-init.
>> This warns about cases where a goto, or a switch, branches across the
>> initialization of a variable. For example:
> Since this covers switch statements, I think an option name only
> mentioning goto is bad; -Wjump-misses-init or -Wjump-across-init would be
> better. OK with that change and otherwise fixed as indicated below.
Thanks. Fixed, updated, rebootstrapped, retested, and committed. I use
-Wjump-misses-init because in a case like
int a = 0;
the initialization is missed, but not crossed.