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 14:56:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 2017-11-08 02:21 PM, Jim Meyering wrote:
On Wed, Nov 8, 2017 at 12:52 PM, Assaf Gordon <address@hidden> wrote:
On 2017-11-08 07:35 AM, Jim Meyering wrote:

src/time.c:664:4: warning: this statement may fall through
[-Wimplicit-fallthrough=]
      usage (EXIT_SUCCESS);
>>
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__));".

Yes, it does feel like it should deduce that...
A workaround is to declare usage like this:

   void usage (int status) ATTRIBUTE_NORETURN;

I've used gnulib's "stdnoreturn" to suppress the warning, here:
 https://git.savannah.gnu.org/cgit/time.git/commit/?id=5d15357e

regards,
 - assaf





reply via email to

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