NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/49685: Missing strtoull(3) in _POSIX_C_SOURCE 200809L
>Number: 49685
>Category: lib
>Synopsis: Missing strtoull(3) in _POSIX_C_SOURCE 200809L
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Feb 22 12:55:00 +0000 2015
>Originator: Kamil Rytarowski
>Release: NetBSD-current, 7, 6, 5
>Organization:
>Environment:
NetBSD compaq 7.99.1 NetBSD 7.99.1 (GENERIC) #0: Fri Nov 7 22:04:53 CET 2014 kamil@chieftec:/tmp/netbsd-tmp/sys/arch/amd64/compile/GENERIC amd64
>Description:
According to POSIX documentation [1]
strtoull(3) is a part of POSIX 2008
For NetBSD it's enabled with:
_ISOC99_SOURCE
STDC_VERSION >= 199901L
_NETBSD_SOURCE
__cplusplus >= 201103L
I'm working on a piece of code which defines -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 and assumes availability of the strtoull(3) function, which causes problems on NetBSD.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/
>How-To-Repeat:
$ cat test.c
#include <stdlib.h>
int main()
{
return strtoull("1", NULL, 0);
}
$ gcc -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -Wall test.c
test.c: In function 'main':
test.c:5:2: warning: implicit declaration of function 'strtoull' [-Wimplicit-function-declaration]
return strtoull("1", NULL, 0);
>Fix:
rearange namespace of strtoull(3) in src/include/stdlib.h
Home |
Main Index |
Thread Index |
Old Index