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

Joseph Myers joseph@codesourcery.com
Thu May 7 21:40:02 GMT 2020


On Thu, 7 May 2020, Martin Sebor via Libc-alpha wrote:

> On 5/7/20 2:00 PM, DJ Delorie 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 ;-)
> 
> I misunderstood the purpose of the macro.  I thought it was for
> warnings that are intended.  It sounds like it's mainly meant to
> suppress false positives?

It's for both - false positives (often "may be used uninitialized", 
needing a detailed analysis in the comment of why it's a false positive) 
and cases where the code (typically a test) is deliberately doing 
something questionable to test how the library handles that questionable 
usage (such as various string function tests, or some printf tests in 
stdio-common/ that need to disable -Wformat).

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list