diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f40807a..a50e456 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,11 +22,17 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest, windows-11-arm] mode: ["--release", "-Zminimal-versions", ""] manifest: ["psm/Cargo.toml", "Cargo.toml"] + # Pedantic flags + cflags: ["-Werror -Wundef", ""] exclude: - rust_toolchain: stable mode: -Zminimal-versions - rust_toolchain: 1.91.0 mode: -Zminimal-versions + - os: windows-latest + cflags: "-Werror -Wundef" + - os: windows-11-arm + cflags: "-Werror -Wundef" include: - os: windows-latest extra_target: i686-pc-windows-msvc @@ -34,6 +40,8 @@ jobs: rust_toolchain: nightly extra_target: arm64ec-pc-windows-msvc timeout-minutes: 10 + env: + CFLAGS: ${{ matrix.cflags }} steps: - uses: actions/checkout@v4 - name: Install Rust ${{ matrix.rust_toolchain }} @@ -101,6 +109,7 @@ jobs: args: --target=${{ matrix.rust_target }} --manifest-path=${{ matrix.manifest }} -- --nocapture env: CC: ${{ matrix.clang_cl }} + CFLAGS: "-Werror -Wundef" windows-gnu-test: name: Test ${{ matrix.manifest }} on ${{ matrix.rust_target }} with ${{ matrix.rust_toolchain }} @@ -139,6 +148,8 @@ jobs: with: command: test args: --target ${{ matrix.rust_target }} --manifest-path=${{ matrix.manifest }} + env: + CFLAGS: "-Werror -Wundef" cross-windows-gnullvm-check: name: Check ${{ matrix.manifest }} to ${{ matrix.rust_target }} with stable diff --git a/psm/src/arch/aarch_aapcs64.s b/psm/src/arch/aarch_aapcs64.s index ee10f8a..b6a2e93 100644 --- a/psm/src/arch/aarch_aapcs64.s +++ b/psm/src/arch/aarch_aapcs64.s @@ -3,14 +3,14 @@ .text -#if CFG_TARGET_OS_darwin || CFG_TARGET_OS_macos || CFG_TARGET_OS_ios +#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) #define GLOBL(fnname) .globl _##fnname #define TYPE(fnname) #define FUNCTION(fnname) _##fnname #define END_FUNCTION(fnname) -#elif CFG_TARGET_OS_windows +#elif defined(CFG_TARGET_OS_windows) #define GLOBL(fnname) .globl fnname #define TYPE(fnname) diff --git a/psm/src/arch/arm_aapcs.s b/psm/src/arch/arm_aapcs.s index 8ab5cae..3a01ae0 100644 --- a/psm/src/arch/arm_aapcs.s +++ b/psm/src/arch/arm_aapcs.s @@ -4,7 +4,7 @@ .text .syntax unified -#if CFG_TARGET_OS_darwin || CFG_TARGET_OS_macos || CFG_TARGET_OS_ios +#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) #define GLOBL(fnname) .globl _##fnname #define THUMBTYPE(fnname) .thumb_func _##fnname diff --git a/psm/src/arch/x86.s b/psm/src/arch/x86.s index 5eec45c..d4b7b39 100644 --- a/psm/src/arch/x86.s +++ b/psm/src/arch/x86.s @@ -4,7 +4,7 @@ .text -#if CFG_TARGET_OS_darwin || CFG_TARGET_OS_macos || CFG_TARGET_OS_ios +#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) #define GLOBL(fnname) .globl _##fnname #define TYPE(fnname) diff --git a/psm/src/arch/x86_64.s b/psm/src/arch/x86_64.s index 9a9b531..3c876d0 100644 --- a/psm/src/arch/x86_64.s +++ b/psm/src/arch/x86_64.s @@ -4,7 +4,7 @@ .text -#if CFG_TARGET_OS_darwin || CFG_TARGET_OS_macos || CFG_TARGET_OS_ios +#if defined(CFG_TARGET_OS_darwin) || defined(CFG_TARGET_OS_macos) || defined(CFG_TARGET_OS_ios) #define GLOBL(fnname) .globl _##fnname #define TYPE(fnname)