This is the mail archive of the
mailing list for the newlib project.
Re: strtof is not defined anymore in std=c++11
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: newlib at sourceware dot org
- Date: Thu, 11 Apr 2013 15:02:47 +0200
- Subject: Re: strtof is not defined anymore in std=c++11
- References: <515AB4D3 dot 8060405 at st dot com> <20130402120003 dot GC32544 at calimero dot vinschen dot de> <515B2D19 dot 10306 at dronecode dot org dot uk> <20130402191949 dot GA3192 at calimero dot vinschen dot de> <5164231C dot 5070001 at dronecode dot org dot uk> <20130411102444 dot GA3050 at calimero dot vinschen dot de> <5166AB5D dot 2060706 at dronecode dot org dot uk>
- Reply-to: newlib at sourceware dot org
On Apr 11 13:23, Jon TURNEY wrote:
> On 11/04/2013 11:24, Corinna Vinschen wrote:
> > 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.
> I'm obviously missing something here, as it WFM.
Indeed. I don't know what I did wrong, but when I tested it, it didn't
work. Now that I'm trying to reproduce it, everything's fine. I reverted
the code to your original patch.