Fix r242743 change of gcc/system.h

Submitted by Gunther Nikl on March 19, 2017, 9:17 p.m.

Details

Message ID 20170319221737.0000591e@justmail.de
State New
Headers show

Commit Message

Gunther Nikl March 19, 2017, 9:17 p.m.
Hello Paolo!

Building older GCC releases with clang tends to issue warnings. This
can be annoying especially when they originate from a header. While
backporting r242743 I noticed that the non-C++ cases of the changed
macro definitions in gcc/system.h are broken. Since GCC trunk is build
in C++ mode this is not an issue, but should be fixed nevertheless I
think.

Regards,
Gunther


gcc:
2017-03-XX  Gunther Nikl  <gnikl@users.sourceforge.net>

	* system.h (HAVE_DESIGNATED_INITIALIZERS,
	HAVE_DESIGNATED_UNION_INITIALIZERS): Fix non C++ case.

Comments

Paolo Bonzini March 19, 2017, 9:24 p.m.
On 19/03/2017 22:17, Gunther Nikl wrote:
> Hello Paolo!
> 
> Building older GCC releases with clang tends to issue warnings. This
> can be annoying especially when they originate from a header. While
> backporting r242743 I noticed that the non-C++ cases of the changed
> macro definitions in gcc/system.h are broken. Since GCC trunk is build
> in C++ mode this is not an issue, but should be fixed nevertheless I
> think.
> 
> Regards,
> Gunther

Of course!  If you have commit access, you can commit this as obvious I
think.

What is the warning like?

Paolo

> 
> gcc:
> 2017-03-XX  Gunther Nikl  <gnikl@users.sourceforge.net>
> 
> 	* system.h (HAVE_DESIGNATED_INITIALIZERS,
> 	HAVE_DESIGNATED_UNION_INITIALIZERS): Fix non C++ case.
> 
> 
> Index: gcc/system.h
> ===================================================================
> --- gcc/system.h	(revision 246106)
> +++ gcc/system.h	(working copy)
> @@ -581,7 +581,7 @@ extern int vsnprintf (char *, size_t, const char *
>  #define HAVE_DESIGNATED_INITIALIZERS 0
>  #else
>  #define HAVE_DESIGNATED_INITIALIZERS \
> -  (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
> +  ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
>  #endif
>  #endif
>  
> @@ -590,7 +590,7 @@ extern int vsnprintf (char *, size_t, const char *
>  #define HAVE_DESIGNATED_UNION_INITIALIZERS (GCC_VERSION >= 4007)
>  #else
>  #define HAVE_DESIGNATED_UNION_INITIALIZERS \
> -  (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
> +  ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
>  #endif
>  #endif
>  
>
Gunther Nikl March 22, 2017, 5:13 p.m.
Paolo Bonzini <bonzini@gnu.org>:
> 
> On 19/03/2017 22:17, Gunther Nikl wrote:
> > Hello Paolo!
> > 
> > Building older GCC releases with clang tends to issue warnings. This
> > can be annoying especially when they originate from a header. While
> > backporting r242743 I noticed that the non-C++ cases of the changed
> > macro definitions in gcc/system.h are broken. Since GCC trunk is
> > build in C++ mode this is not an issue, but should be fixed
> > nevertheless I think.
> > 
> > Regards,
> > Gunther
> 
> Of course!  If you have commit access, you can commit this as obvious
> I think.

No, I don't have commit access. Please commit the patch for me. Thanks.

> What is the warning like?

Sorry, I don't have the warning available :-/ I noticed that there
appears to be a problem because of a patch to the FreeBSD sources back
in September of the last year.

Regards,
Gunther

> > gcc:
> > 2017-03-XX  Gunther Nikl  <gnikl@users.sourceforge.net>
> > 
> > 	* system.h (HAVE_DESIGNATED_INITIALIZERS,
> > 	HAVE_DESIGNATED_UNION_INITIALIZERS): Fix non C++ case.
> > 
> > 
> > Index: gcc/system.h
> > ===================================================================
> > --- gcc/system.h	(revision 246106)
> > +++ gcc/system.h	(working copy)
> > @@ -581,7 +581,7 @@ extern int vsnprintf (char *, size_t, const
> > char * #define HAVE_DESIGNATED_INITIALIZERS 0
> >  #else
> >  #define HAVE_DESIGNATED_INITIALIZERS \
> > -  (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
> > +  ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
> >  #endif
> >  #endif
> >  
> > @@ -590,7 +590,7 @@ extern int vsnprintf (char *, size_t, const
> > char * #define HAVE_DESIGNATED_UNION_INITIALIZERS (GCC_VERSION >=
> > 4007) #else
> >  #define HAVE_DESIGNATED_UNION_INITIALIZERS \
> > -  (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
> > +  ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
> >  #endif
> >  #endif
Jeff Law March 27, 2017, 5:54 p.m.
On 03/19/2017 03:17 PM, Gunther Nikl wrote:
> Hello Paolo!
>
> Building older GCC releases with clang tends to issue warnings. This
> can be annoying especially when they originate from a header. While
> backporting r242743 I noticed that the non-C++ cases of the changed
> macro definitions in gcc/system.h are broken. Since GCC trunk is build
> in C++ mode this is not an issue, but should be fixed nevertheless I
> think.
>
> Regards,
> Gunther
>
>
> gcc:
> 2017-03-XX  Gunther Nikl  <gnikl@users.sourceforge.net>
>
> 	* system.h (HAVE_DESIGNATED_INITIALIZERS,
> 	HAVE_DESIGNATED_UNION_INITIALIZERS): Fix non C++ case.
Thanks.  Installed.

jeff

Patch hide | download patch | download mbox

Index: gcc/system.h
===================================================================
--- gcc/system.h	(revision 246106)
+++ gcc/system.h	(working copy)
@@ -581,7 +581,7 @@  extern int vsnprintf (char *, size_t, const char *
 #define HAVE_DESIGNATED_INITIALIZERS 0
 #else
 #define HAVE_DESIGNATED_INITIALIZERS \
-  (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
+  ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
 #endif
 #endif
 
@@ -590,7 +590,7 @@  extern int vsnprintf (char *, size_t, const char *
 #define HAVE_DESIGNATED_UNION_INITIALIZERS (GCC_VERSION >= 4007)
 #else
 #define HAVE_DESIGNATED_UNION_INITIALIZERS \
-  (((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
+  ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
 #endif
 #endif