C/C++ dialect defaults

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Oliver Smith osmith at sysmocom.de
Wed Sep 18 12:26:14 UTC 2019


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/51b97e354ba9fce1890cf38ecc754aa49677fc89

-- 
- Oliver Smith <osmith at 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



More information about the OpenBSC mailing list