[systemd-devel] compile with clang broken

Lennart Poettering lennart at poettering.net
Fri Aug 15 02:38:25 PDT 2014


On Fri, 15.08.14 10:55, David Herrmann (dh.herrmann at gmail.com) wrote:

> Hm, I don't know whether that works. See the description here:
>     https://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Other-Builtins.html
> 
> What you propose is something like my attached patch, I guess? Along
> the lines of:
>     (__builtin_constant_p(A) && __builtin_constant_p(B)) ?
>         ((A) > (B) ? (A) : (B)) :
>         ({ ....OLD_MAX.... })

Yes, correct.

> Thing is, the ELSE case is not considered a compile-time constant by
> LLVM. 

In that case __builtin_constant_p() would be entirely useless on LLVM,
right? And all uses by this construct in glibc would not work, right?

Thanks for looking into this!

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list