[patch i386]:Ensure intrinsic functions are declared "C"
Jason Merrill
jason@redhat.com
Wed May 12 15:08:00 GMT 2010
On 05/12/2010 10:02 AM, Richard Guenther wrote:
>> The issue, which occures here is, that a user wants - for example - to
>> include <xmmintrin.h> header in C++. Now he includes afterwards for
>> windows the math.h/intrin.h (which both have explicit C language
>> scope). What happens here? A bunch of warnings/failures caused by C++
>> vs. C language scope.
>> So why we shouldn't care?
>
> You'll get ODR violation errors anyway in that case.
I don't think so. If the Windows header just has declarations, they can
merge just fine with the xmmintrin.h definitions -- if they have the
right language linkage.
You'd only get an ODR violation if you have a class/enum/inline/template
defined in multiple translation units that uses the intrinsics but
sometimes sees the definitions in xmmintrin and sometimes not.
Jason
More information about the Gcc-patches
mailing list