snprintf() with g++ -std=c++98: error: 'snprintf' was not declared in this scope

2012-04-04 Thread Denis Excoffier
Hello, It could be that snprintf() is not properly declared in stdio.h. Take the following foo.c: % cat foo.c #include stdio.h int main(void) { char buf[10]; snprintf(buf, 10, %i, 0); return 0; } % In C, perhaps after a remark from Markus

Re: snprintf() with g++ -std=c++98: error: 'snprintf' was not declared in this scope

2012-04-04 Thread Ryan Johnson
On 04/04/2012 9:32 AM, Denis Excoffier wrote: Hello, It could be that snprintf() is not properly declared instdio.h. According to [1], it's not officially part of c++98 (???). Try gnu++98 instead. As for why it's not in c++0x, there's a problem with the macros being defined [2] that AFAIK

Re: snprintf() with g++ -std=c++98: error: 'snprintf' was not declared in this scope

2012-04-04 Thread Denis Excoffier
On Wed, Apr 04, 2012 at 10:02:24AM -0400, Ryan Johnson wrote: On 04/04/2012 9:32 AM, Denis Excoffier wrote: Hello, It could be that snprintf() is not properly declared instdio.h. According to [1], it's not officially part of c++98 (???). Try gnu++98 instead. As for why it's not in c++0x,

Re: snprintf() with g++ -std=c++98: error: 'snprintf' was not declared in this scope

2012-04-04 Thread Corinna Vinschen
On Apr 4 16:54, Denis Excoffier wrote: On Wed, Apr 04, 2012 at 10:02:24AM -0400, Ryan Johnson wrote: On 04/04/2012 9:32 AM, Denis Excoffier wrote: Hello, It could be that snprintf() is not properly declared instdio.h. According to [1], it's not officially part of c++98 (???). Try

Re: snprintf() with g++ -std=c++98: error: 'snprintf' was not declared in this scope

2012-04-04 Thread Ryan Johnson
On 04/04/2012 11:18 AM, Corinna Vinschen wrote: On Apr 4 16:54, Denis Excoffier wrote: On Wed, Apr 04, 2012 at 10:02:24AM -0400, Ryan Johnson wrote: On 04/04/2012 9:32 AM, Denis Excoffier wrote: Hello, It could be that snprintf() is not properly declared instdio.h. According to [1], it's