2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 18:07:40 +00:00

ci: Add jobs to test -std=c99 builds.

It should generally be possible to build OVS with mostly c99 standard
and without GNU extensions.

It's not a pure c99 build, because some non-standard features from
POSIX variants are always enabled if available via
AC_USE_SYSTEM_EXTENSIONS.  Without them we'll not have some essentials
like RW locks, for example.

'-std=c99' doesn't disable all the GNU extensions, only some of them.
It's technically possible to use '-fgnuc-version=0' with clang to
fully disable all the extensions, but it is causing build assertions
with the version of clang provided in Ubuntu 20.04 in GHA (some
issue with packed structures not being correctly packed).  We may
use this option in the future after the base image upgrade.

Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Ilya Maximets 2023-08-22 12:35:41 +02:00
parent f0899b1fcb
commit d910fd8a0f
2 changed files with 10 additions and 0 deletions

View File

@ -82,6 +82,10 @@ if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
install_dpdk install_dpdk
fi fi
if [ "$STD" ]; then
CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -std=$STD"
fi
if [ "$CC" = "clang" ]; then if [ "$CC" = "clang" ]; then
CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -Wno-error=unused-command-line-argument" CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -Wno-error=unused-command-line-argument"
elif [ "$M32" ]; then elif [ "$M32" ]; then

View File

@ -85,6 +85,7 @@ jobs:
LIBS: ${{ matrix.libs }} LIBS: ${{ matrix.libs }}
M32: ${{ matrix.m32 }} M32: ${{ matrix.m32 }}
OPTS: ${{ matrix.opts }} OPTS: ${{ matrix.opts }}
STD: ${{ matrix.std }}
TESTSUITE: ${{ matrix.testsuite }} TESTSUITE: ${{ matrix.testsuite }}
name: linux ${{ join(matrix.*, ' ') }} name: linux ${{ join(matrix.*, ' ') }}
@ -100,6 +101,11 @@ jobs:
- compiler: clang - compiler: clang
opts: --disable-ssl opts: --disable-ssl
- compiler: gcc
std: c99
- compiler: clang
std: c99
- compiler: gcc - compiler: gcc
testsuite: test testsuite: test
- compiler: clang - compiler: clang