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