This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: floot_log2() - two functions with the same name in GCC.
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: martin at dalecki dot de (Marcin Dalecki)
- Cc: gcc at gcc dot gnu dot org (GCC Development), pinskia at physics dot uc dot edu (Andrew Pinski)
- Date: Sat, 21 Jan 2006 22:35:05 -0500 (EST)
- Subject: Re: floot_log2() - two functions with the same name in GCC.
>
>
> On 2006-01-22, at 04:17, Andrew Pinski wrote:
>
> >>
> >> OK. Looking closer I have just found that in gcc/toplev.c
> >>
> >> #if GCC_VERSION < 3004
> >> ...
> >> #endif
> >>
> >> Is missing around the floor_log2() and exact_log2() functions.
> >
> > You are mssing the fact that the ones in the headers are declared
> > as extern inline.
>
> Yes I saw them. However pease look at the if else endif guards in the
> header.
> extern inline is just supposed to guarantee that a copy
> of the function will be spawn out to an .o file when it's seen. Right?
> The variant in toplev.c will be of course generated as well. And then
> it's just link order roulette which one of them will be used...
No. This is GCC "extern inline" and not C99 "extern inline". GCC's
"extern inline" means inline if you can but if we don't inline, use the
external version and don't emit the function in the .o.
-- Pinski