stdio.h and open_memstream()

Natanael Copa natanael.copa at gmail.com
Tue Jan 17 09:31:54 UTC 2012


On Sat, Jan 14, 2012 at 12:36 AM, Khem Raj <raj.khem at gmail.com> wrote:
> On Fri, Jan 13, 2012 at 2:24 PM, Natanael Copa <natanael.copa at gmail.com> wrote:
>> uclibc-0.9.32.1
>>
>> dev32-edge:~/testcase$ cat open_memstream.c
>> #include <stdio.h>
>>
>> int main()
>> {
>>        return open_memstream(NULL, 0);
>> }
>> dev32-edge:~/testcase$ gcc -Wall -Werror open_memstream.c
>> open_memstream.c: In function 'main':
>> open_memstream.c:5:2: error: implicit declaration of function
>> 'open_memstream' [-Werror=implicit-function-declaration]
>> cc1: all warnings being treated as errors
>>
>> Something is wrong. open_memstream should be defined in stdio.h
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/open_memstream.html
>>
>> from the config:
>> UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
>>
>> and to be sure:
>> $ nm -D /lib/libc.so.0.9.32 | grep open_memstream
>> 00028feb T open_memstream
>>
>> So open_memstream() is really there - and it work without -Wall
>> -Werror but stdio.h header or some other define appears to be wrong.
>>
>> This is needed to compile libdrm-2.4.30
>
> What happens if you add -D_GNU_SOURCE to compiler cmdline ?

$ gcc -Wall -Werror -D_GNU_SOURCE open_memstream.c
open_memstream.c: In function 'main':
open_memstream.c:5:2: error: return makes integer from pointer without
a cast [-Werror]
cc1: all warnings being treated as errors


-- 
Natanael Copa


More information about the uClibc mailing list