This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Newlib _ctype_ alias kludge now invalid due to PR middle-end/15700fix.


> Date: Fri, 18 Mar 2005 02:31:09 +0100
> From: Hans-Peter Nilsson <hp@axis.com>

> > Date: Thu, 17 Mar 2005 15:21:59 -0500
> > From: Jeff Johnston <jjohnstn@redhat.com>
> 
> > I have just checked in a patch to newlib that changes the ctype macros to use 
> > __ctype_ptr instead of _ctype_.  In addition, a configuration check is made to 
> > see whether the array aliasing trick can be used or not.
> 
> In doing so, it appears you broke something in the headers,

Looking closer, I think this broke all newlib targets: the GCC
newlib-specific C++ headers knows about _ctype_ and you hid the
declaration from them.  I'm testing this patch now.  Even if you
want to deprecate _ctype_, it needs to stay visible and
compatible for e.g. the gcc-4.0 branch.

2005-03-18  Hans-Peter Nilsson  <hp@axis.com>

        * libc/include/ctype.h (_ctype_): Move declaration
	outside #ifndef __cplusplus.

Index: ctype.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/ctype.h,v
retrieving revision 1.8
diff -p -c -r1.8 ctype.h
*** ctype.h	17 Mar 2005 20:11:23 -0000	1.8
--- ctype.h	18 Mar 2005 02:05:09 -0000
*************** int _EXFUN(_toupper, (int __c));
*** 37,42 ****
--- 37,43 ----
  #define	_B	0200
  
  extern	__IMPORT _CONST char	*__ctype_ptr;
+ extern	__IMPORT _CONST char	_ctype_[];  /* Deprecated.  */
  
  #ifndef __cplusplus
  #define	isalpha(c)	((__ctype_ptr+1)[(unsigned)(c)]&(_U|_L))
*************** extern	__IMPORT _CONST char	*__ctype_ptr
*** 51,58 ****
  #define	isgraph(c)	((__ctype_ptr+1)[(unsigned)(c)]&(_P|_U|_L|_N))
  #define iscntrl(c)	((__ctype_ptr+1)[(unsigned)(c)]&_C)
  
- extern	__IMPORT _CONST char	_ctype_[];  /* Deprecated.  */
- 
  /* Non-gcc versions will get the library versions, and will be
     slightly slower */
  #ifdef __GNUC__
--- 52,57 ----


brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]