mirror of
https://github.com/vlang/v.git
synced 2025-09-15 15:32:27 +03:00
parser: no struct fields warnings in C struct initializations
This commit is contained in:
parent
71b50ae7fd
commit
222fc4b04f
1 changed files with 1 additions and 1 deletions
|
@ -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')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue