Skip to content

Commit 3b2fbcd

Browse files
fix(cmake): Add -Wno-stringop-overflow on certain GCC versions to avoid false positives; Enable Ubuntu 24.04 in CI. (y-scope#140)
Co-authored-by: kirkrodrigues <[email protected]>
1 parent 34620c8 commit 3b2fbcd

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
os:
3434
- "macos-15"
3535
- "ubuntu-22.04"
36+
- "ubuntu-24.04"
3637
build_type:
3738
- "debug"
3839
- "release"

.github/workflows/lint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ jobs:
1717
lint:
1818
strategy:
1919
matrix:
20-
os: ["macos-latest", "ubuntu-latest"]
20+
os:
21+
- "macos-15"
22+
- "ubuntu-24.04"
2123
runs-on: "${{matrix.os}}"
2224
steps:
2325
- uses: "actions/checkout@v4"
@@ -31,7 +33,7 @@ jobs:
3133
- name: "Install task"
3234
run: "npm install -g @go-task/cli"
3335

34-
- if: "matrix.os == 'macos-latest'"
36+
- if: "matrix.os == 'macos-15'"
3537
name: "Install coreutils (for md5sum)"
3638
run: "brew install coreutils"
3739

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,18 @@ target_compile_options(log_surgeon PRIVATE
143143
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic -Werror>
144144
)
145145

146+
# Disable -Wstringop-overflow to avoid a false positive in the following compiler versions.
147+
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117983
148+
if("GNU" STREQUAL "${CMAKE_CXX_COMPILER_ID}"
149+
AND ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12
150+
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.5)
151+
OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13
152+
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.4)
153+
OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14
154+
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.3)))
155+
target_compile_options(log_surgeon PRIVATE "-Wno-stringop-overflow")
156+
endif()
157+
146158
# Make off_t 64-bit
147159
target_compile_definitions(log_surgeon
148160
PRIVATE

0 commit comments

Comments
 (0)