Patch to fix irix5 & irix6 libstdc++-v3 scan_not() implementations

Benjamin Kosnik bkoz@redhat.com
Mon May 13 03:49:00 GMT 2002


> The current implementation of scan_is() vs scan_not() for the
> libstdc++-v3 irix ports don't agree on what the base of the ctype
> lookup table is.  If you look at scan_is() it starts at `_M_table,'
> while scan_not() starts at `_M_table + 1'.  One of them has to be
> wrong. :-) And in fact my irix box currently fails the testcase I
> wrote in the patch below.

OK. Having testcases for this makes it easier to understand.

> IMHO, the current code allows these kinds of typos to creep in because
> it manually inlines the this->is() function.  I find the code more
> readable and safer by calling this->is() and letting the compiler
> inline it for me.

OK.

> Okay to install on the trunk?

Yes, with changes.

> 2002-05-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
> 
> 	* config/os/irix/irix5.2/bits/ctype_inline.h (scan_is,
> 	scan_not): Fix typo, use this->is() rather than manually (and
> 	perhaps incorrectly) inlining it.
> 	* config/os/irix/irix6.5/bits/ctype_inline.h (scan_is,
> 	scan_not): Likewise.

OK.

> 	* testsuite/22_locale/ctype_scan.cc: New file.

This is ok, but you'll need to name it ctype_scan_char.cc. There's an
existing file, ctype_members_char that would include this functionality
(which sadly has no functional test for scan... whoops), but your tests
are pretty extensive so we might as well break it out now, since you've
been kind enough to code up nice tests.

Usually, a wide test is added too (see the rest of the tests in that
directory.) Since wide support is off on Irix, it might make sense for
me to do that after you've committed this. If you'd like, I can add that
later, or you can do it now, either way it's ok.

thanks,
benjamin



More information about the Libstdc++ mailing list