From 222fc4b04f295dce10fb84d15309a1ea38ea6092 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 25 Jan 2020 07:15:49 +0100 Subject: [PATCH] parser: no struct fields warnings in C struct initializations --- vlib/compiler/struct.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/compiler/struct.v b/vlib/compiler/struct.v index 3b16504d4d..2beb9be198 100644 --- a/vlib/compiler/struct.v +++ b/vlib/compiler/struct.v @@ -422,7 +422,7 @@ fn (p mut Parser) struct_init(typ_ string) string { continue } field_typ := field.typ - if !p.builtin_mod && field_typ.ends_with('*') && p.mod != 'os' && + if !p.builtin_mod && field_typ.ends_with('*') && !p.is_c_struct_init && p.mod != 'os' && p.mod != 'ui' { p.warn('reference field `${typ}.${field.name}` must be initialized') }