[Asterisk-Dev] always_inline change...

Luigi Rizzo rizzo at icir.org
Fri Nov 4 08:42:22 MST 2005


i think the recent change to implement force_inline is not done properly,
+++ asterisk/include/asterisk/compiler.h	2005/11/01 20:09:09	1.4
because it assumes the attribute is supported by all versions of gcc,
and it is probably not  - surely it breaks compilation on gcc 2.95
with -Werror while it works with gcc 3.4.4

Given that the same file already has a conditional section for
builtin_expect which looks at the gcc version number,
how about writing the entire file as follows ?

	#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
	#define __builtin_expect(exp, c) (exp)
	#define force_inline inline
	#else
	#define force_inline inline __attribute__((always_inline))
	#endif

(or something equivalent matching the first gcc version where
always_inline is properly supported) ?

	cheers
	luigi



More information about the asterisk-dev mailing list