From nobody@FreeBSD.ORG Sat Nov 27 20:33:04 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id AF32D14DD8; Sat, 27 Nov 1999 20:33:04 -0800 (PST)
Message-Id: <19991128043304.AF32D14DD8@hub.freebsd.org>
Date: Sat, 27 Nov 1999 20:33:04 -0800 (PST)
From: tomoaki@biol.s.u-tokyo.ac.jp
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: _T is defined in ctype.h and breaks c++ library using "typename _T..."
X-Send-Pr-Version: www-1.0

>Number:         15127
>Category:       misc
>Synopsis:       _T is defined in ctype.h and breaks c++ library using "typename _T..."
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 27 20:40:01 PST 1999
>Closed-Date:    Wed Feb 9 23:38:32 PST 2000
>Last-Modified:  Wed Feb  9 23:41:22 PST 2000
>Originator:     Tomoaki NISHIYAMA
>Release:        FreeBSD-3.3 RELEASE
>Organization:
The University of Tokyo
>Environment:
FreeBSD koke.nibb.ac.jp 3.3-RELEASE FreeBSD 3.3-RELEASE #0: Sun Nov 14 22:56:39 JST 1999     tomoaki@koke.nibb.ac.jp:/usr/src/sys/compile/PH  i386

>Description:
ctype.h defines _T as 
#define _T      0x00100000L             /* Special */
and leave it defined.
Many c++ codes including libstdc++ uses the identifier _T, which will
be confused by this #define.
>How-To-Repeat:
$ cat test.c
#include <ctype.h>
_T
$ cc -E test.c |tail -1
0x00100000L 

>Fix:
#undef _T and other unnecessary defines before returning from the header.
--- ctype.h.orig        Sun Nov 28 13:21:05 1999
+++ ctype.h     Sun Nov 28 13:23:28 1999
@@ -179,4 +179,18 @@
 __END_DECLS
 #endif /* using inlines */
 
+#undef _A
+#undef _C
+#undef _D
+#undef _G
+#undef _L
+#undef _P
+#undef _S
+#undef _U
+#undef _X
+#undef _B
+#undef _R
+#undef _I
+#undef _T
+#undef _Q
 #endif /* !_CTYPE_H_ */


>Release-Note:
>Audit-Trail:

From: Tomoaki NISHIYAMA <tomoaki@biol.s.u-tokyo.ac.jp>
To: freebsd-gnats-submit@freebsd.org
Cc: tomoaki@biol.s.u-tokyo.ac.jp
Subject: Re: misc/15127
Date: Sun, 28 Nov 1999 15:57:14 +0900

 Sorry, the fix I proposed in the pr misc/15127 will break up
 the is* macros.
 I would alternatively propose to substitute
 _? to _CTYPE_?.
 for example
 substitute _T with _CTYPE_T
 -- 
 Tomoaki Nishiyama
   e-mail:tomoaki@biol.s.u-tokyo.ac.jp
          Department of Biological Sciences,
 Graduate School of Science, The University of Tokyo
 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Wed Feb 9 23:38:32 PST 2000 
State-Changed-Why:  
problem fixed in 4-CURRENT 
. 


Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Wed Feb 9 23:38:32 PST 2000 
Responsible-Changed-Why:  
I took care of the problem. 
>Unformatted:
