[cfe-dev] clang doesn't compile simple code

Reid Kleckner rnk at google.com
Mon Apr 21 13:31:26 PDT 2014


We already define __declspec for mingw compatibility, so adding the ccs
seems reasonable.

I'm curious if you can fix most of your errors with -fms-extensions by
dropping your intrin-impl.h header and including clang's intrin.h instead.
 You'll have to hack out the _MSC_VER ifdef there.  If that works, it might
be worth making clang's intrin.h header available when targeting mingw.


On Mon, Apr 21, 2014 at 12:45 PM, fprijate <prijatelj.francek at gmail.com>wrote:

> Hi
>
> Thanks Reid.
> I tried it before and it actually works in this simple case.
>
> The problem is that I have I big project with about 10000  files which
> is portable and which compiles fine on many platforms
> (win,linux,bsd,osx,android) with many compilers.
>
> Before -fms-extensions I had a few errors in only one file
> (which i can solve with a few #ifdef tricks).
>
> After I put globaly - CFLAGS +=-fms-extensions in my make file , I get
> houndreds of errors in connection with intrinsics.
> Like :
> ../intrin-impl.h:960:10: error: definition of builtin function
> '_InterlockedExchangeAdd'
> __LONG32 _InterlockedExchangeAdd(__LONG32 volatile *Addend, __LONG32 Value)
> {
>
> ...
>
> Of course I can make bigger changes in my build system or in my header
> files.
> But I think that main idea is that we will have on windows two clang
> compilers.
> One msvc compatible (name ,abi,  parameters ...) which will be replacement
> for msvc compiler and
> other mingw (gcc) compatible.
>
> There are thousands of prejects which compile fine with gcc (mingw).
> It would be a nice if they compile out of a box with clang (with maybe some
> additional attribute).
>
> regards
> FranĨek
>
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/clang-doesn-t-compile-simple-code-tp4038903p4038924.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140421/c5d6d13e/attachment.html>


More information about the cfe-dev mailing list