Hi Vadim,
On Sat, Oct 30, 2021 at 01:40:38AM +0300, Vadim Yanitskiy wrote:
TL;DR, using OSMO_IS_{LITTLE,BIG}_ENDIAN macros without including the <osmocom/core/endian.h> header leads to empty struct definitions, and thus weird compiler warnings like 'struct `foo` has no member `bar`'.
I think a more "automatic" solution to catch those errors is to try to build with -Wundef. For libosmocore, there is currently some fall-out with EMBEDDED (we'd have to explicitly #define EMBEDDED 0 via autoconf).
The advantage of the -Wundef approach is that it should work for all such 'forgot to include a header defining a macro' use cases, and it doesn't require an external tool for validation. Just add -Wundef to our normal build flags.