bug-time
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-time] time-1.8: building with gcc7 and --enable-gcc-warnings fa


From: Assaf Gordon
Subject: Re: [Bug-time] time-1.8: building with gcc7 and --enable-gcc-warnings fails
Date: Wed, 8 Nov 2017 13:52:05 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Hello Jim,

On 2017-11-08 07:35 AM, Jim Meyering wrote:
Thanks a lot for reviving GNU time and for making a new release.
Sorry I didn't see this sooner:
...
src/time.c: In function 'getargs':
src/time.c:664:4: warning: this statement may fall through
[-Wimplicit-fallthrough=]
     usage (EXIT_SUCCESS);
     ^~~~~~~~~~~~~~~~~~~~
src/time.c:665:2: note: here
   case 'o':
   ^~~~

Thanks for the report.

I wonder could this be a false-positive?

The function usage() never returns, it always calls exit(3),
and exit(3) is marked as "__attribute__ ((__noreturn__));".

If I specifically mark usage() as "noreturn",
the warning disappears.

Does gcc-7 not able to deduce the non-return-ness of usage() ?


thanks,
 - assaf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]