From 1b9711edde47ac1d9fb79079d4047a23f8ef7a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=C3=A4schle?= Date: Fri, 18 Sep 2020 15:36:40 +0200 Subject: [PATCH] gen: fix C warnings by cleaning up skip_struct_init (#6416) * gen: removes struct name from list which shouldn't be initialized * gen: vfmt * cgen: remove the skip_struct_init list * Revert "cgen: remove the skip_struct_init list" This reverts commit d9e1fdbb4c869b3d07c43aa07a1b3f73bcc0aacc. * fix ci * vfmt vlib/v/gen/cgen.v Co-authored-by: Delyan Angelov --- vlib/v/gen/cgen.v | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index 3d27e203f3..ade16eaecd 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -3446,15 +3446,14 @@ fn (mut g Gen) go_back_out(n int) { } const ( - skip_struct_init = ['strconv__ftoa__Uf32', 'strconv__ftoa__Uf64', 'strconv__Float64u', 'struct stat', - 'struct addrinfo', - ] + skip_struct_init = ['struct stat', 'struct addrinfo'] ) fn (mut g Gen) struct_init(struct_init ast.StructInit) { styp := g.typ(struct_init.typ) mut shared_styp := '' // only needed for shared &St{... if styp in skip_struct_init { + // needed for c++ compilers g.go_back_out(3) return }