bug-gnulib
[Top][All Lists]
Advanced

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

-Wundef in *.h [was: [PATCH v2] stat-time: silence -Wunused-parameter re


From: Eric Blake
Subject: -Wundef in *.h [was: [PATCH v2] stat-time: silence -Wunused-parameter regression]
Date: Wed, 3 Jan 2018 09:07:54 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

On 01/03/2018 04:53 AM, Tim Rühsen wrote:
> ... here is another one in lib/cdef.h occurring with a  MinGW build.
> 
> 
> In file included from ../lib/libc-config.h:149:0,
>                  from ../lib/glob.h:24,
>                  from utils.c:35:
> ../lib/cdefs.h:298:6: warning: "__USE_FORTIFY_LEVEL" is not defined,
> evaluates to 0 [-Wundef]
>  # if __USE_FORTIFY_LEVEL > 0
>       ^~~~~~~~~~~~~~~~~~~
> 

How come it doesn't trigger a warning in lib/stdio.in.h?  At any rate,
-Wundef is slightly different than -Wunused-parameter, but I _do_ see
cases where we have catered to it in .h files:

lib/cdefs.h:#if defined __GNUC__ && __GNUC__ >= 2
lib/file-set.h:#if defined __GNUC__ && ((__GNUC__ == 3 && __GNUC_MINOR__
>= 3) || __GNUC__ > 3)
lib/gettext.h:#if defined ENABLE_NLS && ENABLE_NLS
lib/obstack.h:# if !defined __GNUC_MINOR__ || __GNUC__ * 1000 +
__GNUC_MINOR__ < 2008

and since cdefs.h is in that group, feel free to submit a patch to have
the use of __USE_FORTIFY_LEVEL pacify -Wundef.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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