Strange behaviour in derived class when using -std=c++0x

Jakob van Bethlehem j.s.van.bethlehem@astro.rug.nl
Sun Feb 20 17:58:00 GMT 2011


Hello everyone,

Thanks a lot for all the quick feedback. In the end it was like I kind 
of feared this rather silly think of happening to choose the name 
'errno' for my particular variable. Changing that was the fix. I don't 
actually include <errno.h> directly into the code, but I do include 
things like <string.h> and <strings.h>, which presumable do include 
<errno.h> indirectly. And yes, these where indeed not in the example 
code I sent. All in all a good learning experience. Thanks!

Greetings, Jakob

On 02/20/2011 03:51 PM, Ian Lance Taylor wrote:
> Axel Freyn<axel-freyn@gmx.de>  writes:
>
>> Nevertheless, I haven't checked what the standards of C++ and C++0x say
>> about "errno", but probably the compiler is right...
> The standard says that "errno" is a macro defined in<errno.h>, a macro
> "which expands to a modifiable lvalue."  If you #include<errno.h>  it's
> unwise to use errno as an identifier name.
>
> Ian



More information about the Gcc-help mailing list