This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to fix thinko
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Re: C++ PATCH to fix thinko
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 15 May 2000 19:05:20 -0600
- cc: Richard Henderson <rth at cygnus dot com>, "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, TYann at vet dot com dot au, gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <u94s7zcoh3.fsf@decepticon.cygnus.com>you write:
> >>>>> Richard Henderson <rth@cygnus.com> writes:
>
> > On Mon, May 15, 2000 at 07:11:25PM -0400, Kaveh R. Ghazi wrote:
> >> How about using __builtin_constant_p() to make sure the string really
> >> is constant and issue a compile time error if its not?
>
> > How about using strlen instead of sizeof, which is what
> > you were after anyway.
>
> Yes! gcc already knows how to optimize strlen of a constant.
Agreed!
jeff