[Patch/mingw32] Don't depend on MS runtime for classic ctype table.\
Danny Smith
dannysmith@clear.net.nz
Tue Jul 10 22:52:00 GMT 2007
> >2007-06-25 Danny Smith <dannysmith@users,sourceforge.net>
> >
> > * config/os/mingw32/ctype_noninline.h: Provide a local
> >_S_classic_table.
> >
Hello,
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/1.cc 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 <dannysmith@users.sourceforge.net>
* config/os/mingw32/ctype_base.h: Use the generic libstdc++
masks
rather than MSVCRT defines.
* config/os/mingw32/ctype_noninline.h (classic_table): Construct
and return a static classic table based on generic libstdc++
masks.
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
Danny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mingw-config.diff
Type: application/octet-stream
Size: 9660 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070710/5fa95144/attachment.obj>
More information about the Libstdc++
mailing list