bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] m4: Remove ternary operator from extern-inline


From: Martin Kletzander
Subject: Re: [PATCH] m4: Remove ternary operator from extern-inline
Date: Tue, 6 Jun 2017 17:11:47 +0200
User-agent: Mutt/1.5.24 (2015-08-30)

On Mon, Jun 05, 2017 at 04:14:38PM +0200, Bruno Haible wrote:
Hi,

Martin Kletzander wrote:
When compiling libvirt with updated GCC (v7.1.0), the following warning
pops out (which then ends up treated like an error):

../config.h:2994:48: error: this use of "defined" may not be portable 
[-Werror=expansion-to-defined]
             || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \

If I remove the ternary operator, the warning/error goes away.

This warning (-Wexpansion-to-defined) is documented in [1]:

  Warn whenever ‘defined’ is encountered in the expansion of a macro
  (including the case where the macro is expanded by an ‘#if’ directive).

What is the expansion of _FORTIFY_SOURCE in your case?
(You can use "gcc -E -dM" to determine it.)

If it does contain the 'defined' keyword, please fix that.


It certainly does!  Thank you very much for your time and the helpful
information.  It was the build system of my distribution what actually
caused this issue.  So I provided a fix for that.

Have a nice day,
Martin

If not, you have found a GCC bug. Please report it at [2].
And disable -Werror until it gets fixed. Gnulib does *not* support the use of
-Werror. [3]

Bruno

[1] https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Warning-Options.html
[2] https://gcc.gnu.org/bugs/
[3] https://www.gnu.org/software/gnulib/manual/html_node/warnings.html


Attachment: signature.asc
Description: Digital signature


reply via email to

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