libstdc++/8694: <string> breaks <ctype.h> on HP-UX 10.20

dimitri@sources.redhat.com dimitri@sources.redhat.com
Sun Nov 24 10:58:00 GMT 2002


>Number:         8694
>Category:       libstdc++
>Synopsis:       <string> breaks <ctype.h> on HP-UX 10.20
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 24 10:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     dimitri at trolltech com
>Release:        gcc-3.2.1
>Organization:
>Environment:
$ uname -srvmi
HP-UX B.10.20 A 9000/715 2000649461
>Description:
Including <string> breaks <ctype.h> on HP-UX 10.20 with gcc 3.1 or gcc 3.2. For example compiling the attached foo.cc results in an error:

$ ####################################
$ # with the gcc-3.2 compiler: ERROR #
$ ####################################
$ /usr/local/gcc-3.2.1/bin/g++ -v
Reading specs from /usr/local/gcc-3.2.1/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.2.1/specs
Configured with: ../gcc-3.2.1/configure --prefix=/usr/local/gcc-3.2.1 --enable-shared --with-gnu-as --with-as=/opt/binutils/bin/as --without-gnu-ld
Thread model: single
gcc version 3.2.1
$ /usr/local/gcc-3.2.1/bin/g++ -c foo.cc
foo.cc: In function `int main()':
foo.cc:4: `_isprint' undeclared (first use this function)
foo.cc:4: (Each undeclared identifier is reported only once for each function
   it appears in.)
$ 
$ #################################
$ # with the gcc-3.0 compiler: OK #
$ #################################
$ /opt/gcc-3.0.2/bin/g++ -v
Reading specs from /opt/gcc-3.0.2/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0.2/specs
Configured with: /tmp/gcc-3.0.2/configure --prefix=/opt/gcc-3.0.2 --enable-shared --with-gnu-as --without-gnu-ld --enable-languages=c++
Thread model: single
gcc version 3.0.2
$ /opt/gcc-3.0.2/bin/g++ -c foo.cc
$ 

The error seems to be caused by <string> defining _SB_CTYPE_MACROS, which breaks <ctype.h> on HP-UX 10.20.

This error has been introduced in gcc-3.1. It looks like a regression caused by this bad fix:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6501

The broken file is:
include/c++/3.2.1/hppa1.1-hp-hpux10.20/bits/os_defines.h
and it looks like:
// Use macro form of ctype functions to ensure __SB_masks is defined.
#define _SB_CTYPE_MACROS 1
>How-To-Repeat:
compile the attached file on HP-UX 10.20 using gcc-3.1 or gcc-3.2
>Fix:

I suggest teh bad fix from:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6501
is reverted. Macro _SB_CTYPE_MACROS was not defined in gcc-3.0 and it used to work just fine.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="foo.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.cc"

I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGN0eXBlLmg+CmludCBtYWluKCkgewogICAgaXNw
cmludCgnYScpOwp9Cg==



More information about the Gcc-bugs mailing list