This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Type safe vector API
Andreas Schwab writes:
> Andreas Schwab <schwab@suse.de> writes:
>
> > Paul Brook <paul@codesourcery.com> writes:
> >
> >> On Tuesday 29 June 2004 16:29, Andrew Pinski wrote:
> >>> > I can no longer bootstrap after this patch. It's because
> >>> > ~0u is not necessarily as wide as size_t.
> >>> >
> >>> > With this patch I can bootstrap:
> >>>
> >>> But it is wrong as ll is a C99 but not C90. I cannot remember
> >>> if ul is C90 though.
> >>
> >> Isn't the proper solution ~(size_t)0
> >
> > The proper solution is (size_t)-1.
>
> And you don't even need the cast if you have prototypes in scope.
That's my guess, but it's hard to see what the author is trying to
accomplish. The test is
if (reserve + 1)
rather than the more obvious
if (reserve != ~0u)
which is how reserve is set... ?
Andrew.