[PATCH] debug/tst-longjmp_chk2: Make signal handler more conservative [BZ #20248]

Paul Eggert eggert@cs.ucla.edu
Wed Jun 15 18:38:00 GMT 2016


Florian Weimer wrote:
> I brought this up on the GCC list.  But I don't think there will be any movement
> unless I submit a patch …
>
> Florian

For what it's worth, Gnulib uses a different approach in its ignore-value 
module.  To ignore the value returned by (say) fchown, one writes this:

   ignore_value (fchown (fd, 0, 0));

and the ignore_value macro is defined this way:

   #if 3 < __GNUC__ + (4 <= __GNUC_MINOR__)
   # define ignore_value(x) \
       (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; }))
   #else
   # define ignore_value(x) ((void) (x))
   #endif


I never understood why GCC generated warnings for expressions cast to void, as 
that was the longstanding idiom for "I know this returns a value, and I don't 
want it."



More information about the Libc-alpha mailing list