[cfe-commits] r127308 - /cfe/trunk/tools/c-index-test/c-index-test.c

NAKAMURA Takumi geek4civic at gmail.com
Tue Mar 8 19:02:29 PST 2011


Author: chapuni
Date: Tue Mar  8 21:02:28 2011
New Revision: 127308

URL: http://llvm.org/viewvc/llvm-project?rev=127308&view=rev
Log:
c-index-test.c: Fix cygwin warning not to pass signed char to islower(c).

Cygwin's ctype.h says;
/* These macros are intentionally written in a manner that will trigger
   a gcc -Wall warning if the user mistakenly passes a 'char' instead
   of an int containing an 'unsigned char'.
   (snip) */

Modified:
    cfe/trunk/tools/c-index-test/c-index-test.c

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=127308&r1=127307&r2=127308&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Tue Mar  8 21:02:28 2011
@@ -990,7 +990,7 @@
 
 int my_stricmp(const char *s1, const char *s2) {
   while (*s1 && *s2) {
-    int c1 = tolower(*s1), c2 = tolower(*s2);
+    int c1 = tolower((unsigned char)*s1), c2 = tolower((unsigned char)*s2);
     if (c1 < c2)
       return -1;
     else if (c1 > c2)





More information about the cfe-commits mailing list