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: Richard Henderson <rth at cygnus dot com>
- Subject: Re: C++ PATCH to fix thinko
- From: Jason Merrill <jason at cygnus dot com>
- Date: 15 May 2000 17:45:12 -0700
- Cc: "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
- References: <200005152311.TAA11552@caip.rutgers.edu> <20000515165538.B5722@cygnus.com>
>>>>> 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.
Jason