Skip to content

Changes

Summary

  1. utils: use built-in static_assert() if available (details)
Commit 57731f73a6ff411383736420bbafe2a653e884b6 by Vadim Yanitskiy
utils: use built-in static_assert() if available

Static assertion is part of the C language since C11.  It produces
more readable [user supplied] error messages than:

  error: size of array ‘dummy_foo_bar’ is negative

and is generally smarter than the current osmo_static_assert()
implementation as it would fail when non-constant expression is
given, whereas osmo_static_assert() would have no effect at all.

See also https://en.cppreference.com/w/c/language/_Static_assert.

Change-Id: I5ca34bc14c05e8c38c721d7df33feb1c6c41c76e
The file was modified include/osmocom/core/utils.h