[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-16 Thread csaba_22 at yahoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

Csaba Ráduly csaba_22 at yahoo dot co.uk changed:

   What|Removed |Added

 CC||csaba_22 at yahoo dot co.uk

--- Comment #11 from Csaba Ráduly csaba_22 at yahoo dot co.uk ---
That is not going to work.

$ gcc -dumpversion
4.8.2

$ gcc -E -dM -x c /dev/null | egrep -i 'ansi|std'
#define _stdcall __attribute__((__stdcall__))
#define __STDC_HOSTED__ 1
#define __stdcall __attribute__((__stdcall__))
#define __STDC__ 1

$ g++ -dumpversion
4.8.2

$ g++ -E -dM -x c++ /dev/null | egrep -i 'ansi|std'
#define _stdcall __attribute__((__stdcall__))
#define __STDC_HOSTED__ 1
#define __stdcall __attribute__((__stdcall__))
#define __STDC__ 1

[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-16 Thread csaba_22 at yahoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

--- Comment #12 from Csaba Ráduly csaba_22 at yahoo dot co.uk ---
Doh. Disregard me.

$ g++ -std=c++11 -E -dM -x c++ /dev/null | egrep -i 'ansi|std|plus'
#define __STDC_HOSTED__ 1
#define __STRICT_ANSI__ 1
#define __cplusplus 201103L
#define __stdcall __attribute__((__stdcall__))
#define __GNUC_STDC_INLINE__ 1
#define __STDC__ 1

[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread zosrothko at orange dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

--- Comment #1 from zosrothko at orange dot fr ---
This issue applies also to other C functions like strdup, realpath, strerror_r,
strsep, etc..


[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek jakub at gcc dot gnu.org ---
stdio.h is provided by cygwin, not GCC, so IMHO you should report it there
instead.


[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread zosrothko at orange dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

--- Comment #3 from zosrothko at orange dot fr ---
(In reply to Jakub Jelinek from comment #2)
 stdio.h is provided by cygwin, not GCC, so IMHO you should report it there
 instead.

on the cygwin mailling list, cygwin states that it is a bug in gcc... see this
thread: http://cygwin.com/ml/cygwin/2012-04/msg00140.html

Thus I am a little bit puzzled...


[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread zosrothko at orange dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

--- Comment #4 from zosrothko at orange dot fr ---
(In reply to Jakub Jelinek from comment #2)
 stdio.h is provided by cygwin, not GCC, so IMHO you should report it there
 instead.

and by the way, it compiles fine when using -std=gnu++11


[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread zosrothko at orange dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

--- Comment #5 from zosrothko at orange dot fr ---
This is a snipet from usr/include/stdio.h

#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ = 199901L)
#ifndef _REENT_ONLY
int _EXFUN(asiprintf, (char **, const char *, ...)
   _ATTRIBUTE ((__format__ (__printf__, 2, 3;
char *  _EXFUN(asniprintf, (char *, size_t *, const char *, ...)
   _ATTRIBUTE ((__format__ (__printf__, 3, 4;
char *  _EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char
*__restrict, ...)
   _ATTRIBUTE ((__format__ (__printf__, 3, 4;
int _EXFUN(asprintf, (char **__restrict, const char *__restrict, ...)
   _ATTRIBUTE ((__format__ (__printf__, 2, 3;
#ifndef diprintf
int _EXFUN(diprintf, (int, const char *, ...)
   _ATTRIBUTE ((__format__ (__printf__, 2, 3;
#endif
int _EXFUN(fcloseall, (_VOID));
int _EXFUN(fiprintf, (FILE *, const char *, ...)
   _ATTRIBUTE ((__format__ (__printf__, 2, 3;
int _EXFUN(fiscanf, (FILE *, const char *, ...)
   _ATTRIBUTE ((__format__ (__scanf__, 2, 3;
int _EXFUN(iprintf, (const char *, ...)
   _ATTRIBUTE ((__format__ (__printf__, 1, 2;
int _EXFUN(iscanf, (const char *, ...)
   _ATTRIBUTE ((__format__ (__scanf__, 1, 2;
int _EXFUN(siprintf, (char *, const char *, ...)
   _ATTRIBUTE ((__format__ (__printf__, 2, 3;
int _EXFUN(siscanf, (const char *, const char *, ...)
   _ATTRIBUTE ((__format__ (__scanf__, 2, 3;
int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict,
...)
   _ATTRIBUTE ((__format__ (__printf__, 3, 4;


[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org ---
As C++ isn't C, obviously it g++ -std=c++11 doesn't define __STDC_VERSION__
macro, but just defines
__STRICT_ANSI__ 1
__cplusplus 201103L
Should be more than enough for cygwin headers to do the right thing.


[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread zosrothko at orange dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

--- Comment #7 from zosrothko at orange dot fr ---
(In reply to Jakub Jelinek from comment #6)
 As C++ isn't C, obviously it g++ -std=c++11 doesn't define __STDC_VERSION__
 macro, but just defines
 __STRICT_ANSI__ 1
 __cplusplus 201103L
 Should be more than enough for cygwin headers to do the right thing.

Ok but gnu++1 doesn't define __STDC_VERSION__ neither but it compiles
fine...so??

$ g++ -xc++ -std=gnu++11 -dM -E -  /dev/null | sort | grep STDC
#define __GNUC_STDC_INLINE__ 1
#define __STDC_HOSTED__ 1
#define __STDC__ 1

$ g++ -xc++ -std=c++11 -dM -E -  /dev/null | sort | grep STDC
#define __GNUC_STDC_INLINE__ 1
#define __STDC_HOSTED__ 1
#define __STDC__ 1


[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

--- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org ---
Sure, but with -std=gnu++11 __STRICT_ANSI__ isn't defined (as intended).


[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

--- Comment #9 from Jonathan Wakely redi at gcc dot gnu.org ---
Definitely a Cygwin bug, their header should test:

#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ = 199901L) || (__cplusplus
= 201103L)

That way the functions will be defined for any -std=gnuNN mode, for C99, and
for C++11, which would be correct.


[Bug c++/60498] error: 'snprintf' was not declared in this scope

2014-03-11 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60498

--- Comment #10 from Jakub Jelinek jakub at gcc dot gnu.org ---
Note, you've listed also plenty of non-standard functions like asiprintf, I
guess those certainly shouldn't be available for __STRICT_ANSI__, even for
-std=c99, -std=c11 or -std=c++11.