Skip to content

Commit

Permalink
ci: check public headers compile with c89 pedantic errors
Browse files Browse the repository at this point in the history
  • Loading branch information
64 committed Oct 24, 2024
1 parent 091620b commit dd76a35
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ jobs:
- name: Build mlibc
run: 'xbstrap install ${{matrix.builds}}'
working-directory: build/
- name: Check public headers conform to C89/C99/C11
if: ${{matrix.builds == 'mlibc-headers-only'}}
working-directory: build/
run: |
GCC_ARCH="${{matrix.arch}}"
case "$GCC_ARCH" in
"x86")
GCC_ARCH="i686"
;;
esac
ALL_HDRS="packages/${{matrix.builds}}/usr/include/**.h"
GCC_ARGS="$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"
# For C89, exclude complex.h, and -Wlong-long
printf -- '-include\0%s\0' $ALL_HDRS | sed 's/complex.h/stdio.h/' | xargs -0 $GCC_ARGS -std=c89 -Wno-long-long
printf -- '-include\0%s\0' $ALL_HDRS | xargs -0 $GCC_ARGS -std=c99
printf -- '-include\0%s\0' $ALL_HDRS | xargs -0 $GCC_ARGS -std=c11
- name: Test mlibc
run: 'meson test -v -C pkg-builds/${{matrix.builds}}'
working-directory: build/
Expand Down

0 comments on commit dd76a35

Please sign in to comment.