[vlc-devel] [PATCH] Added check for _Static_assert and C++11 static_assert.

Rafaël Carré rafael.carre at gmail.com
Tue Nov 26 19:44:17 CET 2013


Are you missing -stdc=c11 ?


Maxim Bublis <b at codemonkey.ru> a écrit :
>>
>> Well, I'm not quite sure how it is possible for the standard C and
>C++
>> libraries to disagree on static_assert() (and all the while the C and
>C++
>> compilers agree on _Static_assert()...). But I cannot blame you for
>being
>> pedantic.
>>
>
>Suddenly clang and clang++ is a such pair of compilers (both shipped
>with
>XCode 5.0.2).
>
>Clang:
>
>$ cat test.c
>#include <assert.h>
>int main() {
>    static_assert(1, "This shouldn't happen");
>    return 0;
>}
>
>$ clang test.c
>test.c:3:5: warning: implicit declaration of function 'static_assert'
>is
>invalid in C99 [-Wimplicit-function-declaration]
>    static_assert(1, "This shouldn't happen");
>    ^
>1 warning generated.
>Undefined symbols for architecture x86_64:
>  "_static_assert", referenced from:
>      _main in test-akB09x.o
>ld: symbol(s) not found for architecture x86_64
>clang: error: linker command failed with exit code 1 (use -v to see
>invocation)
>
>Clang++:
>
>$ cat test.cc
>#include <cassert>
>int main() {
>    static_assert(1, "This shouldn't happen");
>    return 0;
>}
>$ clang++ test.cc
>$ echo $?
>0
>
>
>> However, please use configure caching when writing compiler tests.
>
>
>I'll resubmit patch with configure caching in a few minutes.
>
>
>-- 
>Maxim Bublis
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20131126/2e180a2c/attachment.html>


More information about the vlc-devel mailing list