From 62bedcad9570899647490144df7816849f464ba3 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 13 Aug 2025 15:03:00 +0200 Subject: [PATCH] test-signalhandler.cpp: fixed `-Wunused-macros` warning on macOS ``` /Users/runner/work/cppcheck/cppcheck/test/signal/test-signalhandler.cpp:20:9: error: macro is not used [-Werror,-Wunused-macros] 20 | #define _GNU_SOURCE // required to have feenableexcept() | ^ ``` --- test/signal/test-signalhandler.cpp | 2 ++ test/signal/test-signalhandler.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/signal/test-signalhandler.cpp b/test/signal/test-signalhandler.cpp index 335a9426d5f..31634f15640 100644 --- a/test/signal/test-signalhandler.cpp +++ b/test/signal/test-signalhandler.cpp @@ -16,9 +16,11 @@ * along with this program. If not, see . */ +#if !defined(__APPLE__) #ifndef _GNU_SOURCE #define _GNU_SOURCE // required to have feenableexcept() #endif +#endif #include "config.h" diff --git a/test/signal/test-signalhandler.py b/test/signal/test-signalhandler.py index 6def987e328..1ed700d7ec8 100644 --- a/test/signal/test-signalhandler.py +++ b/test/signal/test-signalhandler.py @@ -39,7 +39,7 @@ def test_assert(): if sys.platform == "darwin": assert stderr.startswith("Assertion failed: (false), function my_assert, file test-signalhandler.cpp, line "), stderr else: - assert stderr.endswith("test-signalhandler.cpp:41: void my_assert(): Assertion `false' failed.\n"), stderr + assert stderr.endswith("test-signalhandler.cpp:43: void my_assert(): Assertion `false' failed.\n"), stderr lines = stdout.splitlines() assert lines[0] == 'Internal error: cppcheck received signal SIGABRT - abort or assertion' # no stacktrace of macOS