This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Disable warnings in string/tester.c at top level
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 2 Oct 2019 17:22:18 +0000
- Subject: Re: Disable warnings in string/tester.c at top level
- Ironport-sdr: uDBkPoWA2KN3LTZqsYeagwIsN1aoC8j1YKmbJVRkqIG2S5AmJl4UScWzyo5PjNO4ig0CEUhW8b WZ9ExoiV2K46VYy6IzuQrBDZCLe9A+L4EmiseK1v58g3wlaisIQg/st1a8HYbtYQ9aNec+t2uq E4KfpdYqjpsDInWHkWJeQ9zVGb1yUKdbvhYeCspXcjFnUgGWxLb497206KmbYYE4PqwOZ9Aepk VJJR5XBBQo1em2MixoDOqBcBjV5LwD4OPUhcYCnoF/niPt5/cboeToGdEP/AxNB+WxICM3GaDX Kb8=
- Ironport-sdr: 1pdqP2cJz0Y1eT8AWdKGAUqltAqVhsZb5e/HZrpGXRqwj64TrhiAHRsWb9ySG2S5+UN0infvVi sH/L4tPzevyizy7J//3h8SNLBGBQZBAfxeMAWhycKxd1KNKkH3eL0IdyvaCdbH1N+ksfWCNHh1 D6CGkOB81Kc/xstrCSg+YXEtLIFADD3xtWoyrk5O/L6MkpcPMgMyn0NLX19WPRnEOypyq7Heac f5PHAYPp/MjY1Ntzm/nubMedMlxxRnq0adi+GUsAlT0/c6dnd8upS4xVn88021npdAKEa8c98H YTg=
- References: <alpine.DEB.2.21.1910021652380.28156@digraph.polyomino.org.uk> <87wodnm66j.fsf@oldenburg2.str.redhat.com>
On Wed, 2 Oct 2019, Florian Weimer wrote:
> * Joseph Myers:
>
> > diff --git a/string/tester.c b/string/tester.c
> > index 24b0dad1cb..128d2c7731 100644
> > --- a/string/tester.c
> > +++ b/string/tester.c
> > @@ -34,6 +34,20 @@
> > #include <fcntl.h>
> > #include <libc-diag.h>
> >
> > +/* This file tests a range of corner cases of string functions,
> > + including cases where truncation occurs or where sizes specified
> > + are larger than the actual buffers, which result in various
> > + warnings. */
> > +DIAG_IGNORE_NEEDS_COMMENT (8, "-Warray-bounds");
> > +DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Wmemset-transposed-args");
> > +#if __GNUC_PREREQ (7, 0)
> > +DIAG_IGNORE_NEEDS_COMMENT (9, "-Wrestrict");
> > +DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
> > +#endif
> > +#if __GNUC_PREREQ (8, 0)
> > +DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-truncation");
> > +#endif
> > +
>
> Should this come before the #include directives, in case the headers
> contain inline functions?
We've generally moved away from such inlines in installed headers. This
position follows stdio-common/tst-printf.c which also disables some
warnings at top level after all the headers have been included.
--
Joseph S. Myers
joseph@codesourcery.com