Skip to content

Commit d9593a0

Browse files
committed
gtk.cfg: the g_ascii_formatd() value must be initialized
Review of the previous commit: the variadic argument lacked the <not-uninit/> that gnu.cfg gives its variadic arguments, so an uninitialized struct member passed as the value was only reported as uninitvar, without uninitStructMember.
1 parent 65c0efe commit d9593a0

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎cfg/gtk.cfg‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,6 +3300,7 @@
33003300
</arg>
33013301
<arg nr="variadic" direction="in">
33023302
<not-bool/>
3303+
<not-uninit/>
33033304
</arg>
33043305
</function>
33053306
<!-- gboolean g_ascii_isalnum(gchar c); -->

‎test/cfg/gtk.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,4 +679,11 @@ void g_ascii_formatd_format_test(const gchar *format, int i)
679679
// cppcheck-suppress invalidFunctionArgBool
680680
g_ascii_formatd(buf, sizeof(buf), format, i == 1);
681681
g_print("%s", buf);
682+
683+
struct {
684+
double x;
685+
} s;
686+
// cppcheck-suppress [uninitvar, uninitStructMember]
687+
g_ascii_formatd(buf, sizeof(buf), format, s.x);
688+
g_print("%s", buf);
682689
}

0 commit comments

Comments
 (0)