develooper Front page | perl.perl5.porters | Postings from January 2019

[perl #133760] Please define _GNU_SOURCE unconditionally on Linux tomake memmem() available

Thread Previous | Thread Next
From:
Tony Cook via RT
Date:
January 13, 2019 23:22
Subject:
[perl #133760] Please define _GNU_SOURCE unconditionally on Linux tomake memmem() available
Message ID:
rt-4.0.24-27824-1547421740-412.133760-15-0@perl.org
On Sat, 12 Jan 2019 13:20:23 -0800, aranea@aixah.de wrote:
> I disagree. glibc too only defines memmem() conditionally (#ifdef
> __USE_GNU, which itself is enabled under various circumstances, for
> example if _GNU_SOURCE is defined). That Perl currently works on glibc
> systems is pure luck (__USE_GNU is probably already defined for other
> reasons), and this might change at any time.

It's not pure luck.

The generated config.h with glibc has:

#define HAS_GNULIBC     /**/
#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
#   define _GNU_SOURCE
#endif

Does musl define symbols similar to __GLIBC__ that can be used to detect musl at build-time?

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=133760

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About