[asterisk-dev] [asterisk-commits] tilghman: trunk r232164 - in /trunk: ./ include/asterisk/ main/

Tilghman Lesher tlesher at digium.com
Sat Dec 5 08:38:14 CST 2009


On Wednesday 02 December 2009 12:57:43 Tilghman Lesher wrote:
> On Wednesday 02 December 2009 06:49:29 Kevin P. Fleming wrote:
> > SVN commits to the Asterisk project wrote:
> > > Author: tilghman
> > > Date: Tue Dec  1 21:26:16 2009
> > > New Revision: 232164
> > >
> > > URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=232164
> > > Log:
> > > So apparently, some platforms don't have ffsll(3).
> > > The manpage lies; it says that the function is in POSIX, but that's
> > > only for ffs(3), not ffsll(3).
> >
> > Since we already require gcc for compilation, and gcc provides
> > __builtin_ffsll(), this should not be necessary. In fact, Russell has
> > already changed the code to use __builtin_ffsll() anyway.
>
> The GCC manual states that if no optimizations are done for the builtin
> function, then the compiler will emit a call to the library function,
> instead. Given that development typically runs with the DONT_OPTIMIZE flag
> set, it would seem to suggest that for platforms which do not have this
> function, we would be making it impossible to debug or develop code there,
> without supplying this function.
>
> I'm open to being proved wrong, but it looks like we need to tread
> carefully to use any of the __builtin_ variety of functions in our code to
> get around cross-platform issues.  GCC states their use only makes sense
> for
> optimization.
>
> http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#Other-Builtins

Just as a followup to this, for the archives, Russell's fix broke compilation
on OpenBSD 4.2.  So that change was reverted, with this compat function as
the only change.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list