At Mon, 5 May 2025 11:30:22 +0200, Michael Bäuerle <micha%NetBSD.org@localhost> wrote: Subject: Re: Some rambling about strdup()'s standard and other standards issues > > Greg A. Woods wrote: > > > > [strdup] > > In any case the OpenGroup "Issue 6" spec definitely has strdup(), and it > > refers to "IEEE Std 1003.1-2001" as the origin of this definition. > > However they say it was moved from being an _XOPEN_SOURCE extension > > "first released in Issue 4, Version 2", and "Moved to BASE" in the > > previous version, "Issue 5". > > > > https://pubs.opengroup.org/onlinepubs/007904975/functions/strdup.html > > > > Hmmm.... > > It is marked as part of the "XSI option", this means that "_XOPEN_SOURCE" > must be defined (to 600 for SUSv3, but it was already defined in SUSv2, > this means 500 would be sufficient). Ah, yes, sorry, I missed that, again, even though it's in a high-lit colour! > C23 is required to get strdup() without POSIX extensions. Ah ha! I see! I had not yet looked at C23 directly. Somehow I didn't expect that, but it explains the success of '-std=c23' more concretely! -- Greg A. Woods <gwoods%acm.org@localhost> Kelowna, BC +1 250 762-7675 RoboHack <woods%robohack.ca@localhost> Planix, Inc. <woods%planix.com@localhost> Avoncote Farms <woods%avoncote.ca@localhost>
Attachment:
pgpYHgGJIIzuZ.pgp
Description: OpenPGP Digital Signature