From 6614f6711424271d40a66dcb1e3cf333bbd495c6 Mon Sep 17 00:00:00 2001 From: Matt Staveley-Taylor Date: Tue, 15 Oct 2024 02:14:41 +0200 Subject: [PATCH] ci: check public headers compile with c89 pedantic errors --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2aed69db9d..66acd36e22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,6 +53,19 @@ jobs: - name: Build mlibc run: 'xbstrap install ${{matrix.builds}}' working-directory: build/ + - name: Check public headers conform to C89 + if: ${{matrix.builds == 'mlibc-headers-only'}} + working-directory: build/ + run: | + GCC_ARCH="${{matrix.arch}}" + case "$GCC_ARCH" in + "x86") + GCC_ARCH="i386" + ;; + esac + printf -- '-include\0%s\0' packages/${{matrix.builds}}/usr/include/**.h | \ + sed 's/complex.h/stdio.h/' | \ + xargs -0 $GCC_ARCH-linux-mlibc-gcc -x c -S /dev/null -o /dev/null -I packages/${{matrix.builds}}/usr/include -I packages/linux-headers/usr/include -nostdlib -std=c89 -Wpedantic -Werror -D__MLIBC_PEDANTIC_HEADER_CHECKER=1 - name: Test mlibc run: 'meson test -v -C pkg-builds/${{matrix.builds}}' working-directory: build/