Re: about "cpu.h: Fix compiler detection" patch

Erik de Castro Lopo <[email protected]>
Newsgroups gmane.comp.audio.compression.flac.devel
Organization Erik Conspiracy Secret Labs
Message-ID <[email protected]>
lvqcl wrote:

> So I thought that the directive
> 
>     #if defined __clang__ && __has_attribute(__target__)
> 
> is ok for GCC because "defined __clang__" is false and
> preprocessor shouldn't try to parse "__has_attribute(...)" part.

It seems this is actually a pre-processor parsing bug. It hits
the bug *before* the logic is evaluated. My current solution in
the above PR is to avoid `__has_attribute` and use this:

    #elif defined __clang__ && (__clang_major__ > 3 || \
          (__clang_major__ == 3 && __clang_minor__ >= 6)) /* clang */

which I have tested with clang 3.6. If someone has an earlier version
of clang and can verify that it work, I'll drop the version number.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
_______________________________________________
flac-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/flac-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.