[PATCH] debug/tst-longjmp_chk2: Make signal handler more conservative [BZ #20248]
Mike Frysinger
vapier@gentoo.org
Mon Jun 13 18:42:00 GMT 2016
On 13 Jun 2016 16:23, Florian Weimer wrote:
> On 06/13/2016 04:03 PM, Mike Frysinger wrote:
> > On 13 Jun 2016 13:11, Florian Weimer wrote:
> >> +static void
> >> +write_message (const char *message)
> >> +{
> >> + ssize_t unused __attribute__ ((unused));
> >> + for (int i = 0; i < pass; ++i)
> >> + unused = write (STDOUT_FILENO, " ", 1);
> >> + unused = write (STDOUT_FILENO, message, strlen (message));
> >
> > are you just trying to ignore the wur markings on write ? you can use
> > this style instead:
> > if (write (...))
> > {
> > /* ignored */
> > }
> >
> > which i'm sure can be macroed.
>
> I believe the __attribute_ ((unused)) approach is the recommended way to
> suppress this warning. Everything else is just gaming the GCC optimizers.
it's the game that a number of GNU project rely upon quite a bit last
i looked
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160613/9a4adbc8/attachment.sig>
More information about the Libc-alpha
mailing list