This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] debug/tst-longjmp_chk2: Make signal handler more conservative [BZ #20248]
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Date: Wed, 15 Jun 2016 11:38:44 -0700
- Subject: Re: [PATCH] debug/tst-longjmp_chk2: Make signal handler more conservative [BZ #20248]
- Authentication-results: sourceware.org; auth=none
- References: <20160613111111 dot 79B3D4022A42D at oldenburg dot str dot redhat dot com> <20160613140304 dot GT4053 at vapier dot lan> <e6a3257b-f9f6-a17f-5ec7-d8e5b9486237 at redhat dot com> <20160613184252 dot GV4053 at vapier dot lan> <c00dd1ed-6929-2ac6-1f51-6a927222bf2a at redhat dot com>
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."