Hello Osmocom community,
how about we set the C and C++ dialect defaults in for each Osmocom
program? Then we would not run into the kind of errors, where code
compiled without errors in the gerrit verification jenkins job, but
failed to compile elsewhere because a different GCC uses different
default dialects. We ran into this already with differences in gerrit
verification and master builds [1], and it can easily happen when
building the binary packages for the various Debian versions and
derivatives in OBS.
In [2] is an example patch for OsmoPCU, hardcoding the following
dialects (gnu89 is the same as the linux kernel uses [3]).
CXXFLAGS="$CXXFLAGS -std=gnu++03"
CFLAGS="$CFLAGS -std=gnu89"
(Note that we can't use the non-gnu dialects, libosmocore won't build
with those.)
Is anybody against doing this, or has other recommendations for dialects
we should use?
Regards,
Oliver
[1]
https://osmocom.org/issues/3598
[2]
https://gerrit.osmocom.org/c/osmo-pcu/+/15565
[3]
https://github.com/torvalds/linux/commit/51b97e354ba9fce1890cf38ecc754aa496…
--
- Oliver Smith <osmith(a)sysmocom.de>
https://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte