This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] ctype<char>::is(const char* __low, const char* __high, mask* __vec) const throw()
- To: Jason Merrill <jason at redhat dot com>
- Subject: Re: [v3] ctype<char>::is(const char* __low, const char* __high, mask* __vec) const throw()
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Tue, 19 Dec 2000 11:51:06 -0800 (PST)
- cc: gcc-patches at gcc dot gnu dot org
You're right.
>
> > ! int __i = 0; // Lowest bitmask.
> > ! while (__i < __bitmasksize && !(__m & static_cast<mask>(1 << __i)))
> > ! ++__i;
> > ! *__vec = static_cast<mask>(1 << __i);
> > ! }
>
> I don't understand this change; it seems that you're changing the function
> to only output the first value that applies, so that for the letter 'A' the
> output mask would only have the isupper bit set (and not, say, the isalpha
> bit). Surely the old code was correct?
It was correct for table-based ctypes (of which gnu-linux is a member.)
I've reverted this patch, and added testcases so that this will be a
regression if it ever comes back. For non-table based approaches, it was
never correct. I've made a generic implementation, perhaps it will work
for these platforms.
> > ===================================================================
> > + VERIFY ( i01 != i02 != i03 != i04 != i05 != i06 != i07 != i08 != i09 );
>
> C doesn't work this way.
Fixed.
thanks,
benjamin