From ede85739ffa921efb96744ea03a1ba1718ade861 Mon Sep 17 00:00:00 2001 From: correctmost <134317971+correctmost@users.noreply.github.com> Date: Sun, 9 Aug 2026 08:16:32 -0400 Subject: [PATCH] gtk.cfg: Remove pure annotation from g_str_has_prefix/suffix g_str_has_prefix and g_str_has_suffix are not technically pure because they can log to the console if a precondition fails. This partially reverts commit 7cc7c0bb5. --- cfg/gtk.cfg | 1 - test/cfg/gtk.c | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cfg/gtk.cfg b/cfg/gtk.cfg index 5e94a0bbb5c..a1d7763670e 100644 --- a/cfg/gtk.cfg +++ b/cfg/gtk.cfg @@ -5221,7 +5221,6 @@ - false diff --git a/test/cfg/gtk.c b/test/cfg/gtk.c index 6b48bca2f9e..b923135e2d9 100644 --- a/test/cfg/gtk.c +++ b/test/cfg/gtk.c @@ -59,8 +59,14 @@ void validCode(int argInt, GHashTableIter * hash_table_iter, GHashTable * hash_t g_string_free(pGStr1, TRUE); gchar * pGchar1 = g_strconcat("a", "b", NULL); + + // g_str_has_prefix and g_str_has_suffix can have side effects because they use + // g_return_val_if_fail, which logs to the console upon failure + // cppcheck-suppress assertWithSideEffect g_assert_true(g_str_has_prefix(pGchar1, "a")); + // cppcheck-suppress assertWithSideEffect g_assert_true(g_str_has_suffix(pGchar1, "b")); + printf("%s", pGchar1); g_free(pGchar1);