From: SourceForge.net <no...@so...> - 2010-07-06 17:43:49
|
Bugs item #3022047, was opened at 2010-06-27 17:13 Message generated for change (Comment added) made by caldo_de_cana You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3022047&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: mingw runtime Group: Behaves as Documented Status: Closed Resolution: Invalid Priority: 5 Private: No Submitted By: Ramiro Polla (caldo_de_cana) Assigned to: Nobody/Anonymous (nobody) Summary: str[n]casecmp not declared under __STRICT_ANSI__ Initial Comment: $ cat strings.c #include <strings.h> void foo(void) { strcasecmp(NULL, NULL); strncasecmp(NULL, NULL, 0); } $ i686-mingw32-gcc -o strings.o -c strings.c -std=c99 -Werror=implicit-function-declaration strings.c: In function 'foo': strings.c:5: error: implicit declaration of function 'strcasecmp' strings.c:6: error: implicit declaration of function 'strncasecmp' $ cat strcasecmp.diff --- /usr/i686-mingw32/include/string.h.orig 2010-06-27 13:46:10.000000000 -0300 +++ /usr/i686-mingw32/include/string.h 2010-06-27 14:01:04.000000000 -0300 @@ -116,6 +116,9 @@ #endif /* _UWIN */ #endif /* _NO_OLDNAMES */ +#else +int __cdecl __MINGW_NOTHROW strcasecmp (const char*, const char *); +int __cdecl __MINGW_NOTHROW strncasecmp (const char *, const char *, size_t); #endif /* Not __STRICT_ANSI__ */ #ifndef _WSTRING_DEFINED $ sudo patch -p0 < strcasecmp.diff patching file /usr/i686-mingw32/include/string.h $ i686-mingw32-gcc -o strings.o -c strings.c -std=c99 -Werror=implicit-function-declaration $ ---------------------------------------------------------------------- Comment By: Ramiro Polla (caldo_de_cana) Date: 2010-07-06 17:43 Message: Sorry, I got the wrong standard... 'man strcasecmp' says 4.4BSD, POSIX.1-2001. It should be available under some other ifdef then. (Is it possible to change the bug title? I couldn't figure out how. should I open a feature request?) ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2010-07-06 15:43 Message: strcasecmp and strncasecmp are not ANSI required. Therefore of course __STRICT_ANSI__ is going to exclude them. The fix therefore is to not use __STRICT_ANSI__ if you want to use these functions. ---------------------------------------------------------------------- Comment By: Christophe PARIS (toffparis) Date: 2010-07-03 19:26 Message: Thanks for the fix. I'm having the same problem here trying to cross-compile ffmpeg. hope it will be officially fixed soon. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3022047&group_id=2435 |