[flac-dev] about "cpu.h: Fix compiler detection" patch

Erik de Castro Lopo mle+la at mega-nerd.com
Thu Feb 16 07:20:41 UTC 2017

lvqcl wrote:

> After this patch, all FLAC__SSEN_SUPPORTED variables are
> undefined for GCC, so intrinsic versions of functions are
> not compiled into libFLAC.

Sigh!  The C preprocessor is by far the very worst feature of
the C langauge. Its hard to read, hard to debug, hard to 
verify and just incredibly fragile.

> Now, it's basically:

I think its fixed in:


> By the way, what's the problem with GCC 4.6?

The travis build log is at:


> According to <https://gcc.gnu.org/onlinedocs/cpp/If.html>:
> "... and logical operations (&& and ||). The latter two obey the usual  
> short-circuiting rules of standard C."
> 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.

I agree. I would call that error a compiler bug.

Erik de Castro Lopo

More information about the flac-dev mailing list