public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/53178] New: fixinclude needed for iso/ctype_iso.h on Solaris 8
@ 2012-05-01 19:59 skunk at iskunk dot org
  2012-05-02  9:29 ` [Bug other/53178] " steven at gcc dot gnu.org
  2012-05-02 15:58 ` skunk at iskunk dot org
  0 siblings, 2 replies; 3+ messages in thread
From: skunk at iskunk dot org @ 2012-05-01 19:59 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: skunk@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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-02 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-01 19:59 [Bug other/53178] New: fixinclude needed for iso/ctype_iso.h on Solaris 8 skunk at iskunk dot org
2012-05-02  9:29 ` [Bug other/53178] " steven at gcc dot gnu.org
2012-05-02 15:58 ` skunk at iskunk dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).