Bug 6074

Summary: Test __USE_XOPEN2K8 instead of __USE_GNU for several functions in <string.h>
Product: uClibc Reporter: Maarten ter Huurne <maarten>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: minor CC: uclibc-cvs
Priority: P5    
Version: 0.9.33.2   
Target Milestone: 0.9.34   
Hardware: All   
OS: Linux   
URL: http://pubs.opengroup.org/onlinepubs/9699919799/functions/strndup.html
Host: Target:
Build:
Attachments: Patch that changes __USE_GNU to __USE_XOPEN2K8 where appropriate in string.h

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