This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[mingw-runtime bug] gcc2 -Wmissing-prototypes warning in mingw-runtime string.h


I've run into a problem, compiling some code with
gcc-2 -Werror -Wmissing-prototypes.
There are 3 warnings in mingw-runtime <string.h>:
/usr/include/mingw/string.h:166: warning: no previous prototype for
`strcasecmp'
/usr/include/mingw/string.h:172: warning: no previous prototype for
`strncasecmp'
/usr/include/mingw/string.h:184: warning: no previous prototype for
`wcscmpi'

One simple fix is to add a prototype immediately before the definitions.

Details of the change which added the problem follow.


Max.



CVS log and diff on change introducing problem:

RCS file: /home/max/cvsmirror/src-cvs/src/winsup/mingw/include/string.h,v
head: 1.8
branch:
locks: strict
access list:
keyword substitution: o
total revisions: 12; selected revisions: 1
description:
----------------------------
revision 1.7
date: 2002/10/11 01:41:31;  author: dannysmith;  state: Exp;  lines: +9 -3
 * include/string.h (strcasecmp): Make extern __inline__.
 (strncasecmp): Likewise.
 (wcscmpi): Likewise.
============================================================================
=
Index: src/winsup/mingw/include/string.h
diff -u src/winsup/mingw/include/string.h:1.6
src/winsup/mingw/include/string.h:1.7
--- src/winsup/mingw/include/string.h:1.6 Thu Sep 19 06:35:30 2002
+++ src/winsup/mingw/include/string.h Fri Oct 11 02:41:31 2002
@@ -161,11 +161,15 @@
 char* strdup (const char*);
 int strcmpi (const char*, const char*);
 int stricmp (const char*, const char*);
-int strcasecmp (const char*, const char*);
+extern __inline__ int
+strcasecmp (const char * __sz1, const char * __sz2)
+  {return _stricmp (__sz1, __sz2);}
 int stricoll (const char*, const char*);
 char* strlwr (char*);
 int strnicmp (const char*, const char*, size_t);
-int strncasecmp (const char*, const char*, size_t);
+extern __inline__ int
+strncasecmp (const char * __sz1, const char * __sz2, size_t
__sizeMaxCompare)
+  {return _strnicmp (__sz1, __sz2, __sizeMaxCompare);}
 char* strnset (char*, int, size_t);
 char* strrev (char*);
 char* strset (char*, int);
@@ -175,7 +179,9 @@
 #endif /* _UWIN */

 /* NOTE: There is no _wcscmpi, but this is for compatibility. */
-int wcscmpi (const wchar_t*, const wchar_t*);
+extern __inline__ int
+wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2)
+  {return _wcsicmp (__ws1, __ws2);}
 wchar_t* wcsdup (wchar_t*);
 int wcsicmp (const wchar_t*, const wchar_t*);
 int wcsicoll (const wchar_t*, const wchar_t*);


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]