http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53178
Bug #: 53178 Summary: fixinclude needed for iso/ctype_iso.h on Solaris 8 Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other AssignedTo: unassig...@gcc.gnu.org ReportedBy: sk...@iskunk.org Host: i386-pc-solaris2.8 Target: i386-pc-solaris2.8 Build: i386-pc-solaris2.8 Created attachment 27273 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27273 /usr/include/iso/ctype_iso.h from Solaris 8 $ cat ctype.c #include <ctype.h> int main(void) { char c = 'A'; return isgraph(c); } $ gcc -W -Wall -c ctype.c ctype.c: In function 'main': ctype.c:7:2: warning: array subscript has type 'char' [-Wchar-subscripts] This is bad if you're building with -Werror. The problem: $ grep isgraph /usr/include/iso/ctype_iso.h extern int isgraph(int); inline int isgraph(int c) { return (__ctype_mask[c] & _ISGRAPH); } inline int isgraph(int c) { return ((__ctype + 1)[c] & (_P | _U | _L | _N)); } #define isgraph(c) (__ctype_mask[c] & _ISGRAPH) #define isgraph(c) ((__ctype + 1)[c] & (_P | _U | _L | _N)) #define isgraph(c) ((_ctype + 1)[c] & (_P | _U | _L | _N)) The solution: $ grep isgraph /opt/gcc/lib/gcc/i386-pc-solaris2.8/4.7.0/include-fixed/iso/ctype_iso.h extern int isgraph(int); inline int isgraph(int c) { return (__ctype_mask[c] & _ISGRAPH); } inline int isgraph(int c) { return ((__ctype + 1)[c] & (_P | _U | _L | _N)); } #define isgraph(c) (__ctype_mask[(int)(c)] & _ISGRAPH) #define isgraph(c) ((__ctype + 1)[(int)(c)] & (_P | _U | _L | _N)) #define isgraph(c) ((_ctype + 1)[(int)(c)] & (_P | _U | _L | _N)) Same deal with the other isxxxxx() routines. I'm attaching the unmodified system header file for reference.