From f13b4d4a5db85c22991e5f437f1521b0a8970137 Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Tue, 6 Feb 2024 21:35:24 +0100 Subject: [PATCH 1/2] Fix error when loading both gnu.cfg and bsd.cfg --- cfg/gnu.cfg | 2 -- test/testlibrary.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cfg/gnu.cfg b/cfg/gnu.cfg index fb998dee5ae..0e3ae7f7222 100644 --- a/cfg/gnu.cfg +++ b/cfg/gnu.cfg @@ -245,8 +245,6 @@ - - false diff --git a/test/testlibrary.cpp b/test/testlibrary.cpp index fc5b2f1fda0..1bdc06f5182 100644 --- a/test/testlibrary.cpp +++ b/test/testlibrary.cpp @@ -70,6 +70,7 @@ class TestLibrary : public TestFixture { TEST_CASE(container); TEST_CASE(version); TEST_CASE(loadLibErrors); + TEST_CASE(loadLibCombinations); } static bool loadxmldata(Library &lib, const char xmldata[], std::size_t len) @@ -1065,6 +1066,13 @@ class TestLibrary : public TestFixture { // comma followed by dot LOADLIB_ERROR_INVALID_RANGE("-10:0,.5:"); } + + void loadLibCombinations() const { + { + const Settings s = settingsBuilder().library("std.cfg").library("gnu.cfg").library("bsd.cfg").build(); + ASSERT_EQUALS(s.library.defines.empty(), false); + } + } }; REGISTER_TEST(TestLibrary) From fc87492edf9b70f2ac4c0c6b95609f67ade4ba39 Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Tue, 6 Feb 2024 21:49:35 +0100 Subject: [PATCH 2/2] Fix --- test/cfg/gnu.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/test/cfg/gnu.c b/test/cfg/gnu.c index 9b9ba57d71b..a259215153b 100644 --- a/test/cfg/gnu.c +++ b/test/cfg/gnu.c @@ -183,38 +183,6 @@ int uninitvar_getpw(uid_t uid, char *buf) return getpw(someUid, buf); } -// #9323, #9331 -void syntaxError_timercmp(struct timeval t) -{ - (void)timercmp(&t, &t, <); - (void)timercmp(&t, &t, <=); - (void)timercmp(&t, &t, ==); - (void)timercmp(&t, &t, !=); - (void)timercmp(&t, &t, >=); - (void)timercmp(&t, &t, >); -} - -// False negative: #9346 -void uninitvar_timercmp(struct timeval t) -{ - struct timeval uninit; - (void)timercmp(&t, &uninit, <); - (void)timercmp(&uninit, &t, <=); - (void)timercmp(&uninit, &uninit, ==); -} - -void nullPointer_timercmp(struct timeval t) -{ - // cppcheck-suppress constVariablePointer - struct timeval *p=0; - // cppcheck-suppress nullPointer - (void)timercmp(&t, p, <); - // cppcheck-suppress nullPointer - (void)timercmp(p, &t, <=); - // cppcheck-suppress nullPointer - (void)timercmp(p, p, ==); -} - // Declaration necessary because there is no specific / portable header. extern void *xcalloc(size_t nmemb, size_t size); extern void *xmalloc(size_t size);