Bug 6074 - Test __USE_XOPEN2K8 instead of __USE_GNU for several functions in <string.h>
Summary: Test __USE_XOPEN2K8 instead of __USE_GNU for several functions in <string.h>
Status: RESOLVED FIXED
Alias: None
Product: uClibc
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 0.9.33.2
Hardware: All Linux
: P5 minor
Target Milestone: 0.9.34
Assignee: unassigned
URL: http://pubs.opengroup.org/onlinepubs/...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-06 20:06 UTC by Maarten ter Huurne
Modified: 2015-03-18 22:39 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Patch that changes __USE_GNU to __USE_XOPEN2K8 where appropriate in string.h (1.96 KB, patch)
2013-03-06 20:10 UTC, Maarten ter Huurne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maarten ter Huurne 2013-03-06 20:06:58 UTC
Functions such as strndup() are included in POSIX-2008.1, but are still marked as GNU extensions in uClibc. The <string.h> header is based on glibc, so I ran a diff between glibc 2.15 and uClibc 0.9.33.2 of that header file; everywhere glibc checks for __USE_XOPEN2K8 and uClibc checks for __USE_GNU I patched uClibc. The resulting patch is attached.

I only looked at <string.h>, it is likely other headers might need a similar update, but my immediate problem of strndup() not being declared is solved now.
Comment 1 Maarten ter Huurne 2013-03-06 20:10:32 UTC
Created attachment 4790 [details]
Patch that changes __USE_GNU to __USE_XOPEN2K8 where appropriate in string.h
Comment 2 Bernhard Reutner-Fischer 2015-03-18 22:39:41 UTC
XOPEN2K8 updates went in as 0769334e2e1c8848757dcf6ca265b6c1dcf98e5d