__STRICT_ANSI__ with -std=c99

Oleksandr Gavenko gavenko@bifit.com.ua
Mon Mar 22 13:30:00 GMT 2010


My code use strupr func which is defined in string.h.

But with

   $ gcc -std=c99 -c -o grid.o grid.c

I got

grid.c:236: warning: implicit declaration of function 'strupr'.

This is because with -std=c99 gcc define __STRICT_ANSI__:

   $ gcc -std=c99 -dM -E - < /dev/null | grep __STRICT_ANSI__
   #define __STRICT_ANSI__ 1

As say gcc.info __STRICT_ANSI__ is defined if -ansi pass to gcc.
There are no info for -std=c99 option.

This issue many time discussed previously, just google about
"__STRICT_ANSI__ cygwin".

Some patches for math.h done.
I use func that in newlib and not in POSIX/ANSI
but strdup and another funcs in POSIX and also affected.

 From string.h:

#ifndef __STRICT_ANSI__
...
char 	*_EXFUN(strdup,(const char *));
char	*_EXFUN(strupr,(char *));
...
#endif

Current workaround is undefine __STRICT_ANSI__:

   $ gcc -std=c99 -U__STRICT_ANSI__ -c -o grid.o grid.c


Where is proper place to report issue?


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list