This is the mail archive of the mailing list for the GCC 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: [Patch/mingw32] Don't depend on MS runtime for classic ctype table.\

> >2007-06-25  Danny Smith  <dannysmith@users,>
> >
> >	* config/os/mingw32/ctype_noninline.h: Provide a local
> >_S_classic_table. 
> >  


The earlier patch I proposed is not correct

There is a serious conformance problem in the ctype_base masks
defined in libstdc++-c3/config/os/mingw32/ctype_base.h. 22.2.1 reguires
that upper, lower, alpha, digit, xdigit, space, print, cntrl and punct
values to correspond to separate bitmasks. In the MSVCRT defines, on
which the mingw32 defines are based, a separate 'print' bitmask does not
exist (isprint(c) relies on a combination of flags) and 'alpha' flag is
not sufficicient to test isalpha(c) (_ALPHA bit is set only on alpha
characters that are neither upper nor lower).

The logic in ctype_memnbers,cc: _M_convert_to_wmask amd
ctype<wchar_t>::do_is depend on 22.2.1 conformance so we get FAIL
of 22_locale/ctype/scan/wchar_t/ execution test

The mingw-specific fix I propose is define libstdc++-specific ctype
masks in ctype_base.h and the corresponding classic_table in
ctype_noninline.h, as per attachememt

2007-07-11  Danny Smith  <>

	* config/os/mingw32/ctype_base.h: Use the generic libstdc++
	rather than MSVCRT defines.
	* config/os/mingw32/ctype_noninline.h (classic_table): Construct
	and return a static classic table based on generic libstdc++

However, I think a better fix would be construct a generic static const
ctype_base::mask _S_classic_table[256] in
config/os/generic/ctype_noninline.h and just let mingw32 use the generic
code.  I note that newlib (maybe others) has similar problem to mingw32,
but it is not exposed because newlib doesn't define _GLIBCXX_USE_WCHAR_T


Attachment: mingw-config.diff
Description: Binary data

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