[PATCH] avoid GCC 10 test suite warnings (BZ #25219)

Joseph Myers joseph@codesourcery.com
Thu May 7 21:36:56 GMT 2020


On Thu, 7 May 2020, DJ Delorie via Libc-alpha wrote:

> 
> Martin Sebor <msebor@gmail.com> writes:
> > +#if __GNUC_PREREQ (7, 0)
> > +  DIAG_PUSH_NEEDS_COMMENT;
> > +  /* Avoid warnings about the second (size) argument being negative.  */
> > +  DIAG_IGNORE_NEEDS_COMMENT (10.1, "-Wstringop-overflow");
> 
> This means "for gcc 7.0 or higher, ignore -Wstringop-overflow, and
> remember that gcc 10.1 was the last version we saw that needed this."
> 
> I'm not sure that's what you intended ;-)

It looks right to me.  GCC 7 was the first version with 
-Wstringop-overflow.  As GCC 6 is supported for building glibc, a 
conditional is needed, and __GNUC_PREREQ (7, 0) is certainly a safe 
conditional to have there (even if any version from 7 to 10 would in fact 
work for the conditional).

Putting the oldest version with a given option is advantageous if a 
distribution backports the warning (although there can sometimes still be 
problems when the option itself gets backported to an older version, not 
just a new warning for an existing option).

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list