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

Steinar H. Gunderson sgunderson at bigfoot.com
Wed Nov 27 10:48:47 CET 2013

On Wed, Nov 27, 2013 at 10:40:38AM +0100, Rémi Denis-Courmont wrote:
>> I'm not sure if this is really “incompatible”, though? It's perfectly fine
>> to support C++11 but only C99.
> It is fine if you write pure C++11 code. VLC is mixed C/C++, using
> <assert.h> in C++ code. Hence they have to be consistent.

<assert.h> in C++ can mean something entirely different than in C (the
difference between <cassert> and <assert.h> is largely a no-op; in fact,
the difference between <cfoo> and <foo.h> in general isn't as big as many
would believe). It just means that for such a toolchain, you cannot use
static_assert in C code, just in C++; combining such code will be just fine
(well, even more so in the case of static_assert, since it doesn't actually
influence the generated code!). You will need to test differently for the two
languages and disambiguate between the handling based on __cplusplus.

/* Steinar */
Homepage: http://www.sesse.net/

More information about the vlc-devel mailing list