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

Maxim Bublis b at codemonkey.ru
Tue Nov 26 19:56:15 CET 2013


> Are you missing -stdc=c11 ?
>

Nope.

$ clang --std=c11 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-FjUiYF.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++ supports static_assert because of it's definition in C++ library
(as a template).
But in the same time Apple doesn't ship static_assert definition for C
library:
$ grep static_assert /usr/include/assert.h
$ echo $?
1



-- 
Maxim Bublis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20131126/666e5333/attachment.html>


More information about the vlc-devel mailing list