We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2903 - SDL2 include fails with Clang (llvm) 3.6
Summary: SDL2 include fails with Clang (llvm) 3.6
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.5
Hardware: x86 Windows (XP)
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-11 08:24 UTC by mattreecebentley
Modified: 2017-08-13 03:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mattreecebentley 2015-03-11 08:24:40 UTC
Set up clang with codelite according to instructions here:
http://codelite.org/LiteEditor/ClangCompiler
(copy clang.exe and clang.exe to mingw bin folder).

Compilation works fine without SDL2 header included, with it included get 19 errors and 180 warnings, all based around SDL_cpuinfo.h.

Warnings are of the form:

e:/programming/mingw/lib/gcc/mingw32/4.8.1/include\mmintrin.h:45:72: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))


Errors are of the form:

e:/programming/mingw/lib/gcc/mingw32/4.8.1/include\xmmintrin.h:113:19: error: use of undeclared identifier '__builtin_ia32_mulss'
return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B);
Comment 1 mattreecebentley 2015-03-12 03:51:36 UTC
Have now tested with a local build of latest mercurial, no change.
Comment 2 dmikos 2017-02-20 10:53:20 UTC
HI

i am use clang in visual studio 2015 and trying to compile SDL.

Some errors:
"
1>C:\Dev\waytrel2\src\3rdparty\sdl\src\video\SDL_fillrect.c(103,5): error : member reference base type '__m128' (vector of 4 'float' values) is not a structure or union
1>      SSE_BEGIN;
1>      ^~~~~~~~~
1>  C:\Dev\waytrel2\src\3rdparty\sdl\src\video\SDL_fillrect.c(33,9):  note: expanded from macro 'SSE_BEGIN'
"

this can be fixed by 
"#if defined(_MSC_VER) && !defined(__clang__)" in "src\video\SDL_fillrect.c".


Some warnings:
warning : '__SSE__' macro redefined [-Wmacro-redefined]
and warnings related to _ReadWriteBarrier.