On Mon, Jun 25, 2018 at 12:07 PM, Bruno Haible wrote:
...
> OK, done as follows:
>
> 2018-06-25 Bruno Haible
>
> manywarnings: Don't enable -Wjump-misses-init warnings by default.
> * build-aux/gcc-warning.spec: Add -Wjump-misses-init.
> * m4/manywarnings.m4 (gl_MANYWARN
Paul Eggert wrote:
> the warning is not emitted if the program simply does this instead:
>
> int x; x = 10;
>
Indeed: While
===
extern void bar (int);
int foo (int a)
{
if (a == 1) goto one;
int b = 4;
bar (b);
one:
return a;
}
Bruno Haible wrote:
Can someone answer this?
I expect the warning is there because of style reasons, not correctness reasons.
That is, although it's natural when seeing this line:
int x = 10;
to assume that X must always be initialized, this assumption is incorrect if a
goto jumps over
On 06/25/2018 02:00 AM, Bruno Haible wrote:
> Hi Jim, Paul,
>
>> parse-datetime.y: In function 'parse_datetime2':
>> parse-datetime.y:1791:19: error: jump skips variable initialization \
>> [-Werror=jump-misses-init]
>
> First this occurred in af_alg.c
On Sun, Jun 24, 2018 at 5:00 PM, Bruno Haible wrote:
> Hi Jim, Paul,
>
>> parse-datetime.y: In function 'parse_datetime2':
>> parse-datetime.y:1791:19: error: jump skips variable initialization \
>> [-Werror=jump-misses-init]
Hi Bruno,
Didn't this warn
Hi Jim, Paul,
> parse-datetime.y: In function 'parse_datetime2':
> parse-datetime.y:1791:19: error: jump skips variable initialization \
> [-Werror=jump-misses-init]
First this occurred in af_alg.c with pretty standard Linux kernel style
with gotos. [1] Now here.
What i