This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strtof is not defined anymore in std=c++11


Hi Jon,

On Apr  9 15:18, Jon TURNEY wrote:
> $ g++ c99-stdlib-test.cpp -std=c++03 -Werror=implicit-function-declaration
> c99-stdlib-test.cpp: In function âint main()â:
> c99-stdlib-test.cpp:5:27: error: âstrtollâ was not declared in this scope
>    strtoll("1234", NULL , 0);
>                            ^
> c99-stdlib-test.cpp:6:27: error: âstrtoullâ was not declared in this scope
>    strtoull("1234", NULL, 0);
>                            ^
> c99-stdlib-test.cpp:7:22: error: âstrtofâ was not declared in this scope
>    strtof("1234", NULL);
>                       ^
> 
> $ g++ c99-stdlib-test.cpp -std=c++11 -Werror=implicit-function-declaration

Unfortunately, compilation fails when building a plain-C application
since __cplusplus is undefined in that case.  I checked in a patched
patch which also checks if __cplusplus is defined.

> newlib/ChangeLog:
> 
> 2013-04-09  Jon TURNEY  <...>
> 
> 	* libc/include/stdlib.h (strtof, strtoll, strtoull, strtold): Also
> 	prototype if C++11 or later
> 

Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]