Hi Jim,

> I've just pushed the attached, to avoid new warnings when attempting
> to build coreutils with the latest from gnulib:
> +     strftime: don't use __THROW
> +     Each use of __THROW would provoke this from gcc-7-to-be:
> +
> +       lib/strftime.c:371:1: warning: '__leaf__' attribute has no effect \
> +         on unit local functions [-Wattributes]

How is this going to be handled inside glibc? They have nearly the same
code in time/strftime_l.c, and they have the same definitions in <sys/cdefs.h>:

/* GCC can always grok prototypes.  For C++ programs we add throw()
   to help it optimize the function calls.  But this works only with
   gcc 2.8.x and egcs.  For gcc 3.2 and up we even mark C functions
   as non-throwing using a function attribute since programs can use
   the -fexceptions options for C code as well.  */
# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
#  define __THROW       __attribute__ ((__nothrow__ __LEAF))
#  define __THROWNL     __attribute__ ((__nothrow__))
#  define __NTH(fct)    __attribute__ ((__nothrow__ __LEAF)) fct

I don't understand why you see this warning but the glibc developers
haven't noticed it yet??

Bruno


Reply via email to