Skip to content

Commit ea92a73

Browse files
authored
Merge pull request #353 from qw-ctf/warnings
2 parents 8a9caca + 1ee4530 commit ea92a73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3175
-3126
lines changed

.github/workflows/main.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ jobs:
6464
id: cpu-cores
6565
if: matrix.target == 'qvm'
6666

67+
- uses: ammaraskar/gcc-problem-matcher@0.3.0
68+
if: matrix.target != 'qvm'
69+
6770
- name: Checkout q3lcc
6871
uses: actions/checkout@v4
6972
with:
@@ -91,6 +94,34 @@ jobs:
9194
qwprogs.*
9295
compression-level: 9
9396

97+
verify-macos:
98+
runs-on: macos-latest
99+
timeout-minutes: 10
100+
steps:
101+
- name: Checkout
102+
uses: actions/checkout@v4
103+
104+
- uses: ammaraskar/gcc-problem-matcher@0.3.0
105+
106+
- name: Build
107+
run: |
108+
cmake -B builddir -S . -G Xcode -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
109+
cmake --build builddir --config Release --parallel
110+
111+
verify-msvc:
112+
runs-on: windows-latest
113+
timeout-minutes: 10
114+
steps:
115+
- name: Checkout
116+
uses: actions/checkout@v4
117+
118+
- uses: ammaraskar/msvc-problem-matcher@0.3.0
119+
120+
- name: Build
121+
run: |
122+
cmake -B builddir -S . -G "Visual Studio 17 2022"
123+
cmake --build builddir --config Release --parallel
124+
94125
upload:
95126
needs: build
96127
timeout-minutes: 10

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.9.0)
33
# Set project name and languge.
44
project(qwprogs C)
55

6+
include(CheckCCompilerFlag)
7+
8+
set(CMAKE_COLOR_DIAGNOSTICS ON)
9+
610
# CMake option for bot support, we check it below and add C preprocessor directive if required.
711
option(BOT_SUPPORT "Build with bot support" ON)
812
# Option for FTE extensions. We also have some basic support for FTE which does not controlled by this setting.
@@ -152,6 +156,17 @@ if (CMAKE_C_COMPILER_ID STREQUAL "MSVC")
152156
target_compile_options(${PROJECT_NAME} PRIVATE /W4)
153157
else()
154158
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
159+
160+
check_c_compiler_flag("-Wstrict-prototypes" HAS_CFLAG_STRICT_PROTOTYPES)
161+
if (HAS_CFLAG_STRICT_PROTOTYPES)
162+
target_compile_options(${PROJECT_NAME} PRIVATE -Werror=strict-prototypes)
163+
endif()
164+
165+
check_c_compiler_flag("-Wstrlcpy-strlcat-size" HAS_STRLCPY_STRLCAT_SIZE)
166+
if (HAS_STRLCPY_STRLCAT_SIZE)
167+
target_compile_options(${PROJECT_NAME} PRIVATE -Werror=strlcpy-strlcat-size)
168+
endif()
169+
155170
# Do not allow undefined symbols while linking.
156171
if(APPLE)
157172
target_link_options(${PROJECT_NAME} PRIVATE "-Wl,-undefined,error")

0 commit comments

Comments
 (0)