[llvm-commits] PATCH: PR4719 - llvm-gcc should not use duplicate definitions of the same inline function

Mike Stump mrs at apple.com
Mon Aug 17 08:53:36 PDT 2009


On Aug 17, 2009, at 7:24 AM, Shantonu Sen wrote:
>> does this mean that llvm-gcc can no longer be built with gcc before
>> gcc-3.4?  Also, do you understand why the test checks
>> "defined (__cplusplus)"?
>
> My understanding of <http://www.greenend.org.uk/rjk/2003/03/inline.html 
> > is that "static inline" is universally valid and should work for  
> all versions of gcc and clang.

No.  Ignore any page that makes that claim.  Take a look at the  
xmmintrin.h file:

#ifdef __GNUC_STDC_INLINE__
#define __STATIC_INLINE __inline
#else
#define __STATIC_INLINE static __inline
#endif

for an example where static doesn't work.  The above is fine for an  
internal gcc header file, but not ok for portable code...



More information about the llvm-commits mailing list