This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bsd_signal's prototype unavailable when _GNU_SOURCE is defined



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 [1] 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:

* include/features.h
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
using _GNU_SOURCE.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=4c3992fc459322a7c712700ba3244fcb125163d7
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=21445

> 
> On 11-Nov-2017 9:14 pm, "Florian Weimer" <fw@deneb.enyo.de> 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.
>>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]