bug-gnulib
[Top][All Lists]
Advanced

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

Re: new extern inline provokes -Wmissing-declarations warnings


From: Jim Meyering
Subject: Re: new extern inline provokes -Wmissing-declarations warnings
Date: Sun, 05 Aug 2012 18:36:05 +0200

Paul Eggert wrote:
> On 08/05/2012 06:27 AM, Jim Meyering wrote:
>
>> * configure.ac: Disable -Wmissing-declarations to avoid warnings
>> from gnulib's newly extern-inline functions.
>
> This shouldn't be needed if your compiler is sufficiently
> new, because timespec.h's _GL_INLINE_HEADER_BEGIN
> is supposed to suppress those warnings.  If you're using
> GCC 4.7.1 or later, could you please figure out what the issue

I'm using 2-day-old gcc 4.8.0 20120803

> is?  If it's an older GCC, I wouldn't worry about it -- people
> aren't supposed to use --enable-gcc-warnings unless
> they have a sufficiently-new GCC.

Oh, that handles -Wmissing-prototypes,

    #  define _GL_INLINE_HEADER_BEGIN \
         _Pragma ("GCC diagnostic push") \
         _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"")
    #  define _GL_INLINE_HEADER_END \
         _Pragma ("GCC diagnostic pop")
    # endif

while this problem is with -Wmissing-declarations.

    #  define _GL_INLINE_HEADER_BEGIN \
         _Pragma ("GCC diagnostic push") \
         _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"")
         _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"")
    #  define _GL_INLINE_HEADER_END \
         _Pragma ("GCC diagnostic pop")
    # endif

For the record, here's the first compilation failure I see:

  CC       dtotimespec.o
In file included from dtotimespec.c:25:0:
timespec.h:58:1: error: no previous declaration for 'timespec_cmp' 
[-Werror=missing-declarations]
 timespec_cmp (struct timespec a, struct timespec b)
 ^
timespec.h:68:1: error: no previous declaration for 'timespec_sign' 
[-Werror=missing-declarations]
 timespec_sign (struct timespec a)
 ^
timespec.h:82:1: error: no previous declaration for 'timespectod' 
[-Werror=missing-declarations]
 timespectod (struct timespec a)
 ^
cc1: all warnings being treated as errors
make[3]: *** [dtotimespec.o] Error 1



reply via email to

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