public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation)
@ 2003-06-12  9:57 ronald@landheer.com
  2003-06-12 10:17 ` [Bug libstdc++/11170] " giovannibajo@libero.it
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ronald@landheer.com @ 2003-06-12  9:57 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170

           Summary: bug in ctype_inline.h header file (undefined __istype
                    will break compilation)
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ronald@landheer.com
                CC: gcc-bugs@gcc.gnu.org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i386-unknown-freebsd4.7

When building from source (after having built the binutils, a bootstrap compiler
and a freshly ported Newlib) I configured with 
$ ../src/configure --prefix=/home/cross/tmp --target=i386-unknown-freebsd4.7
--with-newlib --disable-threads --disable-shared --enable-languages=c,c++,java 
$ make all install

Make produced a number of errors due to missing header files, but when examining
the ctype_inline.h header file from
i386-unknown-freebsd4.7/libstdc++-v3/include/i386-unknown-freebsd4.7/bits/ctype_inline.h,
in the build directory (which is a symlink to
libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h in the source directory) I
found a rather odd bug:
      42       return _M_table[static_cast<unsigned char>(__c)] & __m;
      43     else
      44       return __istype(__c, __m);
      45   }
      46
Here, __istype is used, while it might not be defined and a couple of lines later:
      56         {
      57 #if defined (_CTYPE_S) || defined (__istype)
      58           *__vec = __maskrune (*__low, upper | lower | alpha | digit |
xdigit
      59                                | space | print | graph | cntrl | punct
| alnum);
      60 #else
      61           mask __m = 0;
Line 57 check whether __istype is defined or not, and in case it isn't, and
alternative piece of code is used, but not defining __istype will still break
the header file.

HTH

rlc


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

* [Bug libstdc++/11170] bug in ctype_inline.h header file (undefined __istype will break compilation)
  2003-06-12  9:57 [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation) ronald@landheer.com
@ 2003-06-12 10:17 ` giovannibajo@libero.it
  2003-06-12 22:18 ` rittle@latour.rsch.comm.mot.com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: giovannibajo@libero.it @ 2003-06-12 10:17 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170


giovannibajo@libero.it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


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

* [Bug libstdc++/11170] bug in ctype_inline.h header file (undefined __istype will break compilation)
  2003-06-12  9:57 [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation) ronald@landheer.com
  2003-06-12 10:17 ` [Bug libstdc++/11170] " giovannibajo@libero.it
@ 2003-06-12 22:18 ` rittle@latour.rsch.comm.mot.com
  2003-06-13  8:33 ` ronald@landheer.com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rittle@latour.rsch.comm.mot.com @ 2003-06-12 22:18 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170



------- Additional Comments From rittle@latour.rsch.comm.mot.com  2003-06-12 22:17 -------
Subject: Re:  New: bug in ctype_inline.h header file (undefined __istype will break compilation)

In article <20030612095704.11170.ronald@landheer.com> you write:

> $ ../src/configure [...] --target=i386-unknown-freebsd4.7 --with-newlib [...]
> [...] Make produced a number of errors due to missing header files [...]

This is not a supported configuration at the moment (this is true for
many "UNIX" cross-targets within libstdc++-v3 AFAIK).  I have no
opinion on whether the above should or should not be supported but we
will review any patches posted to the libstdc++ list to improve that
situation.  For one thing, AFAIK, the libstdc++-v3 configuration
method looks at target triple without regard to presence of
--with-newlib to decide which configuration files to select.  Those
selected files clearly use knowledge of the target OS and expect
system headers to be present not newlib headers.

I.e. if there is a bug, then I suggest it is not in:
libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h
rather it is in the selection process in:
libstdc++-v3/configure* (which should be selecting
libstdc++-v3/config/os/newlib/ctype_inline.h et al. in the presence
of --with-newlib).

Ah, BTW, you thought it was an error to use __istype before checking
it to guard the use of another entity called __maskrune.  That is
not-a-bug (you will have to study the *full* history of
/usr/include/ctype.h on freebsd to understand why).

Regards,
Loren (with both libstdc++-v3 and freebsd maintainer hat on)


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

* [Bug libstdc++/11170] bug in ctype_inline.h header file (undefined __istype will break compilation)
  2003-06-12  9:57 [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation) ronald@landheer.com
  2003-06-12 10:17 ` [Bug libstdc++/11170] " giovannibajo@libero.it
  2003-06-12 22:18 ` rittle@latour.rsch.comm.mot.com
@ 2003-06-13  8:33 ` ronald@landheer.com
  2003-08-06  3:56 ` pinskia at physics dot uc dot edu
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ronald@landheer.com @ 2003-06-13  8:33 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170



------- Additional Comments From ronald@landheer.com  2003-06-13 08:30 -------
Subject: Re:  bug in ctype_inline.h header file (undefined
 __istype will break compilation)

Most of your reply has more to do with PR 11171 than with PR 11170 - is 
that intentional? (PR 11171 notes that the wrong headers are being pulled 
in; PR 11170 is about the FreeBSD headers and __istype)

As for:
> Ah, BTW, you thought it was an error to use __istype before checking it
> to guard the use of another entity called __maskrune.  That is not-a-bug
> (you will have to study the *full* history of /usr/include/ctype.h on
> freebsd to understand why).
I'd love to study the full history of the FreeBSD headers, but I don't 
currently have the time for that. If you say it's not a bug, that's good 
enough for me. (but in that case, shouldn't the PR be resolved as 
"invalid"?)

thx

rlc


On 12 Jun 2003, rittle@latour.rsch.comm.mot.com wrote:
> This is not a supported configuration at the moment (this is true for
> many "UNIX" cross-targets within libstdc++-v3 AFAIK).  I have no
> opinion on whether the above should or should not be supported but we
> will review any patches posted to the libstdc++ list to improve that
> situation.  For one thing, AFAIK, the libstdc++-v3 configuration
> method looks at target triple without regard to presence of
> --with-newlib to decide which configuration files to select.  Those
> selected files clearly use knowledge of the target OS and expect
> system headers to be present not newlib headers.
> 
> I.e. if there is a bug, then I suggest it is not in:
> libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h
> rather it is in the selection process in:
> libstdc++-v3/configure* (which should be selecting
> libstdc++-v3/config/os/newlib/ctype_inline.h et al. in the presence
> of --with-newlib).
> 
> Ah, BTW, you thought it was an error to use __istype before checking
> it to guard the use of another entity called __maskrune.  That is
> not-a-bug (you will have to study the *full* history of
> /usr/include/ctype.h on freebsd to understand why).
> 
> Regards,
> Loren (with both libstdc++-v3 and freebsd maintainer hat on)
> 
> 
> 
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>


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

* [Bug libstdc++/11170] bug in ctype_inline.h header file (undefined __istype will break compilation)
  2003-06-12  9:57 [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation) ronald@landheer.com
                   ` (2 preceding siblings ...)
  2003-06-13  8:33 ` ronald@landheer.com
@ 2003-08-06  3:56 ` pinskia at physics dot uc dot edu
  2003-08-06  8:19 ` blytkerchan at users dot sourceforge dot net
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-06  3:56 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-06 03:56 -------
Why do you want to use NewLib instead of FreeBSD's Libc?


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

* [Bug libstdc++/11170] bug in ctype_inline.h header file (undefined __istype will break compilation)
  2003-06-12  9:57 [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation) ronald@landheer.com
                   ` (3 preceding siblings ...)
  2003-08-06  3:56 ` pinskia at physics dot uc dot edu
@ 2003-08-06  8:19 ` blytkerchan at users dot sourceforge dot net
  2003-08-20 22:11 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: blytkerchan at users dot sourceforge dot net @ 2003-08-06  8:19 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170



------- Additional Comments From blytkerchan at users dot sourceforge dot net  2003-08-06 08:19 -------
Subject: Re:  bug in ctype_inline.h header file (undefined __istype will break compilation)

On Wed, Aug 06, 2003 at 03:56:54AM -0000, pinskia at physics dot uc dot edu wrote:
> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170
> 
> 
> pinskia at physics dot uc dot edu changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |WAITING
> 
> 
> ------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-06 03:56 -------
> Why do you want to use NewLib instead of FreeBSD's Libc?
I don't see how that matters, but it's part of the cross-compiling experiments
I'm running. Eventually, I'll be using the same kind of setup to cross-compile
to AIX and Solaris.

rlc


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

* [Bug libstdc++/11170] bug in ctype_inline.h header file (undefined __istype will break compilation)
  2003-06-12  9:57 [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation) ronald@landheer.com
                   ` (4 preceding siblings ...)
  2003-08-06  8:19 ` blytkerchan at users dot sourceforge dot net
@ 2003-08-20 22:11 ` pinskia at gcc dot gnu dot org
  2003-08-23  0:26 ` dhazeghi at yahoo dot com
  2004-05-26  4:15 ` bkoz at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-20 22:11 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-20 22:11:51
               date|                            |


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-20 22:11 -------
Okay I always through you need to use the OS's libc (or a compatiable one) when building a cross-
compiler but I was wrong.


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

* [Bug libstdc++/11170] bug in ctype_inline.h header file (undefined __istype will break compilation)
  2003-06-12  9:57 [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation) ronald@landheer.com
                   ` (5 preceding siblings ...)
  2003-08-20 22:11 ` pinskia at gcc dot gnu dot org
@ 2003-08-23  0:26 ` dhazeghi at yahoo dot com
  2004-05-26  4:15 ` bkoz at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23  0:26 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170


dhazeghi at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
           Keywords|                            |build
   Target Milestone|3.4                         |---


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

* [Bug libstdc++/11170] bug in ctype_inline.h header file (undefined __istype will break compilation)
  2003-06-12  9:57 [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation) ronald@landheer.com
                   ` (6 preceding siblings ...)
  2003-08-23  0:26 ` dhazeghi at yahoo dot com
@ 2004-05-26  4:15 ` bkoz at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-05-26  4:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-05-25 05:10 -------

I'm going to close this as WONTFIX. Mostly, because the bug 11171, which deals
with --with-newlib, when fixed, will make this one go away. 

Since it's fixed in 3.4.0 and above, this is largely an issue for 3.3.x. 

Which, I suppose, should be fixed.

-benjamin

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11170


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

end of thread, other threads:[~2004-05-25  5:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-12  9:57 [Bug c++/11170] New: bug in ctype_inline.h header file (undefined __istype will break compilation) ronald@landheer.com
2003-06-12 10:17 ` [Bug libstdc++/11170] " giovannibajo@libero.it
2003-06-12 22:18 ` rittle@latour.rsch.comm.mot.com
2003-06-13  8:33 ` ronald@landheer.com
2003-08-06  3:56 ` pinskia at physics dot uc dot edu
2003-08-06  8:19 ` blytkerchan at users dot sourceforge dot net
2003-08-20 22:11 ` pinskia at gcc dot gnu dot org
2003-08-23  0:26 ` dhazeghi at yahoo dot com
2004-05-26  4:15 ` bkoz at gcc dot gnu 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).