Skip to content

Commit 65c0efe

Browse files
committed
gtk.cfg: keep reporting a bool as the g_ascii_formatd() value
Review of the previous commit: dropping <arg nr="4"> also dropped its <not-bool/>, so with a format string that is not a literal a bool passed as the value was no longer reported (invalidFunctionArgBool). Describing arg 4 again makes the format check count it as a fixed argument and report "requires 1 parameter but only 0 are given" again, so describe it as the variadic argument instead, as gnu.cfg does.
1 parent 395ef5e commit 65c0efe

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎cfg/gtk.cfg‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3298,6 +3298,9 @@
32983298
<strz/>
32993299
<formatstr/>
33003300
</arg>
3301+
<arg nr="variadic" direction="in">
3302+
<not-bool/>
3303+
</arg>
33013304
</function>
33023305
<!-- gboolean g_ascii_isalnum(gchar c); -->
33033306
<function name="g_ascii_isalnum">

‎test/cfg/gtk.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,3 +672,11 @@ void g_ascii_formatd_test(double d)
672672
g_ascii_formatd(small, sizeof(buf), "%.2f", d);
673673
g_print("%s", small);
674674
}
675+
676+
void g_ascii_formatd_format_test(const gchar *format, int i)
677+
{
678+
gchar buf[39];
679+
// cppcheck-suppress invalidFunctionArgBool
680+
g_ascii_formatd(buf, sizeof(buf), format, i == 1);
681+
g_print("%s", buf);
682+
}

0 commit comments

Comments
 (0)