This is the mail archive of the
mailing list for the glibc project.
Re: bsd_signal's prototype unavailable when _GNU_SOURCE is defined
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-help at sourceware dot org
- Date: Sat, 11 Nov 2017 21:49:58 -0200
- Subject: Re: bsd_signal's prototype unavailable when _GNU_SOURCE is defined
- Authentication-results: sourceware.org; auth=none
- References: <CAOL8xrUi3wh=JdQp_utpAGsYXOZ-4-PoXReg54cbF=wW7Z30JQ@mail.gmail.com> <email@example.com> <CAOL8xrXq=r2_-DT+24J3tNeAM3SNk-hyopwzWt=kC8Z3=47CkA@mail.gmail.com>
On 11/11/2017 19:34, Ponnuvel Palaniyappan wrote:
> Thanks for the clarification.
> I know the function has removed from posix 2008 and is probably on its way
> out of glibc. But since it's still declared in the header and man page
> documents the necessary feature test macros, I wondered if it's a bug in
> the man page or in glibc code which is supposed to provide bad_signal's
> prototype when necessary macros are defined.
> It's not a serious issue. I worked around it by providing its prototype
> myself if glibc version is 2.26 or later. I am not sure if it's worth
> raising a bug report for this considering it's been removed from posix 2008
> - presumably very low priority for glibc. If you think otherwise, I can
> file a bug report. Thanks.
This was changed intentionally by 4c3992fc45  and it refers to BZ#21445.
As Joseph has put in bugzilla.
"this function was obsoleted in the 2001 edition of POSIX and *removed* in
the 2008 edition, so it should not be declared when the 2008 edition is in use."
Since declaring _GNU_SOURCE implies in all features, including POSIX 2008:
190 #ifdef _GNU_SOURCE
191 # undef _ISOC95_SOURCE
192 # define _ISOC95_SOURCE 1
193 # undef _ISOC99_SOURCE
194 # define _ISOC99_SOURCE 1
195 # undef _ISOC11_SOURCE
196 # define _ISOC11_SOURCE 1
197 # undef _POSIX_SOURCE
198 # define _POSIX_SOURCE 1
199 # undef _POSIX_C_SOURCE
200 # define _POSIX_C_SOURCE 200809L
The obsolete bsd_signal is correctly omitted. Also _GNU_SOURCE implying
_POSIX_C_SOURCE=200809 is set since 3e6b0a28 (2009-02-26).
In fact I would say you should *not* declare it by yourself if you are
> On 11-Nov-2017 9:14 pm, "Florian Weimer" <firstname.lastname@example.org> wrote:
>> * Ponnuvel Palaniyappan:
>>> Is this the expected behaviour? If so, is there a way to make bsd_signal
>>> available whiling _GNU_SOURCE is defined?
>> It's not listed in NEWS, so it's not deliberate. But considering that
>> the function is obsolete, I would say the bug is that it's not
>> mentioned in NEWS, not that the declaration has been removed from the
>> header file.