Skip to content

Commit 80da58a

Browse files
committed
- Fixed a build problem related to the use of -Wstrict-prototypes with Clang.
- Disabled the conformance tests for ARM-based runners in the GitHub Actions CI workflow since these tests take too long. - Changed the GitHub Actions CI release workflow to use the ubuntu-24.04 runner.
1 parent 6b2bf32 commit 80da58a

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
build:
1515
#runs-on: ubuntu-latest
16-
runs-on: ubuntu-22.04
16+
runs-on: ubuntu-24.04
1717
steps:
1818
############################################################
1919
- name: Checkout

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ message("CMAKE_LINKER: ${CMAKE_LINKER}")
314314

315315
# Customize the compiler flags for warning messages.
316316
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
317+
317318
check_c_compiler_flag("-Wno-stringop-truncation"
318319
JAS_GCC_WARN_NO_STRINGOP_TRUNCATION)
319320
check_c_compiler_flag("-Wno-stringop-overflow"
@@ -331,7 +332,16 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
331332
add_c_compile_options(-Wno-sign-compare)
332333
add_c_compile_options(-Wformat)
333334
add_c_compile_options(-Wmissing-prototypes)
334-
add_c_compile_options(-Wstrict-prototypes)
335+
336+
# NOTE: The semantics of -Wstrict-prototypes differs in GCC and Clang.
337+
# GCC does not warn about empty parameter lists in function definitions,
338+
# while Clang does warn about this.
339+
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
340+
add_c_compile_options(-Wstrict-prototypes)
341+
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
342+
add_c_compile_options(-Wno-strict-prototypes)
343+
endif()
344+
335345
add_c_compile_options(-Wno-type-limits)
336346
if (JAS_CLANG_WARN_NO_OUT_OF_RANGE_COMPARE)
337347
add_c_compile_options(-Wno-tautological-constant-out-of-range-compare)
@@ -357,7 +367,9 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
357367
#add_c_compile_options(-Werror)
358368
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
359369
endif()
370+
360371
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
372+
361373
# possibly lossy conversion
362374
add_c_compile_options(/wd4244)
363375
# different const qualifiers
@@ -372,6 +384,7 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
372384
# Treat all compiler warnings as errors.
373385
add_c_compile_options(/WX)
374386
endif()
387+
375388
endif()
376389

377390
if(JAS_ENABLE_HIDDEN)

build/build_all

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,11 @@ debug_level=0
233233
strict=1
234234
command_file=
235235
enable_test=1
236+
enable_conformance_test=1
236237
requested_tests=()
237238
hard_fail=0
238239

239-
while getopts hvb:cnd:swC:Xqt:F option; do
240+
while getopts hvb:cnd:swC:XYqt:F option; do
240241
case "$option" in
241242
n)
242243
enable=0;;
@@ -265,6 +266,8 @@ while getopts hvb:cnd:swC:Xqt:F option; do
265266
strict=1;;
266267
X)
267268
enable_test=0;;
269+
Y)
270+
enable_conformance_test=0;;
268271
h)
269272
usage;;
270273
*)
@@ -298,6 +301,13 @@ $sysinfo_data
298301
================================================================================
299302
EOF
300303

304+
if [ -n "$RUNNER_OS" ]; then
305+
echo "RUNNER_NAME: $RUNNER_NAME"
306+
echo "RUNNER_OS: $RUNNER_OS"
307+
echo "RUNNER_ACTION: $RUNNER_ACTION"
308+
fi
309+
310+
301311
os=unknown
302312
if [ -n "$RUNNER_OS" ]; then
303313
case "$RUNNER_OS" in
@@ -322,6 +332,15 @@ if [ -n "$RUNNER_OS" ]; then
322332
;;
323333
esac
324334
fi
335+
336+
# Disable conformance tests for ARM since these tests take too long.
337+
# Do similarly for Windows.
338+
case "$RUNNER_NAME" in
339+
ubuntu-*-arm|windows-*)
340+
echo "WARNING: disabling conformance tests"
341+
enable_conformance_test=0
342+
;;
343+
esac
325344
fi
326345
#ubuntu_clang_hack=0
327346

@@ -366,16 +385,14 @@ esac
366385

367386
if [ "$enable_test" -ne 0 ]; then
368387
test_option=(--test)
369-
conformance_tests_option=(--conformance-tests)
370388
else
371389
test_option=(--no-test)
372-
conformance_tests_option=(--no-conformance-tests)
373390
fi
374-
case "$os" in
375-
windows)
391+
if [ "$enable_conformance_test" -ne 0 ]; then
392+
conformance_tests_option=(--conformance-tests)
393+
else
376394
conformance_tests_option=(--no-conformance-tests)
377-
;;
378-
esac
395+
fi
379396

380397
################################################################################
381398

0 commit comments

Comments
 (0)