From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11399 invoked from network); 27 Sep 2021 23:35:38 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 27 Sep 2021 23:35:37 -0000 Received: (qmail 17805 invoked by uid 550); 27 Sep 2021 23:35:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 17772 invoked from network); 27 Sep 2021 23:35:28 -0000 Date: Mon, 27 Sep 2021 19:35:15 -0400 From: Rich Felker To: musl@lists.openwall.com Message-ID: <20210927233515.GA4428@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [musl] Promoting extension functions up from _GNU_SOURCE ? In a related discussion on IRC, and in light of merging qsort_r, I noticed that memmem and likely a large number of other functions that we share with the BSDs are only exposed under _GNU_SOURCE. This seems wrong. In some cases that's what glibc is doing too, but that's not a very good reason to do the same. Some of these, like memmem and qsort_r, are even approved for the next issue of POSIX. I think it makes sense to start by making a list of functions that are presently _GNU_SOURCE that the BSDs also have, and then, as long as they are useful (as opposed to legacy junk) functions we want to treat as well-supported functionality, and as long as the names are not problematic, plan to move most or all to _BSD_SOURCE (default exposure). For the ones that are POSIX-future, we could go ahead and move them to baseline _POSIX_C_SOURCE, or wait a bit. Note that we already have some POSIX-future functions like dup3 and pipe2 exposed that way. For ones that are in a reserved namespace (like memmem, which matches the mem* reservation for string.h) I think it'd be very reasonable to move them right away. For the others, we should probably look at possible consequences. Does this sound reasonable? Any volunteers to make such a list?