This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Speed-up get_identifier("main")
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: roger at eyesopen dot com
- Cc: gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Date: Thu, 7 Aug 2003 13:49:16 -0400 (EDT)
- Subject: Re: [PATCH] Speed-up get_identifier("main")
- References: <Pine.LNX.4.44.0308071038070.14580-100000@www.eyesopen.com>
> From: Roger Sayle <roger@eyesopen.com>
>
> > The cast to unsigned of the strlen was only necessary when prototypes
> > were missing in traditional C.
>
> I've kept the explicit cast to (unsigned int) in the latest version of
> my patch. Many compilers issue warnings about implicit loss of precision
> converting the size_t returned by strlen into the unsigned int required
> by the prototype. Whilst an explicit cast isn't required, it helps
> silence compiler warnings from non-GCC host compilers.
<Shrug> okay.
>
> At some point in the future, we may even enable such portability warnings
> by default during GCC bootstraps.
>
> Roger
You mean -Wconversion? IIRC it was too noisy to be useful, especially
on LP64 platforms or targets where HOST_WIDE_INT is long long. But I
haven't tried it in a very long time so I could be mistaken.
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu