ci: use -Wno-excess-initializers for clang -cstrict, cleanup cgen
parent
96e9cc62b0
commit
c900dc1053
|
@ -185,6 +185,7 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
|
|||
// enable additional warnings:
|
||||
'-Wno-unknown-warning' /* if a C compiler does not understand a certain flag, it should just ignore it */,
|
||||
'-Wno-unknown-warning-option' /* clang equivalent of the above */,
|
||||
'-Wno-excess-initializers' /* vlib/v/tests/struct_init_with_complex_fields_test.v fails without that on macos clang 13 */,
|
||||
'-Wdate-time',
|
||||
'-Wduplicated-branches',
|
||||
'-Wduplicated-cond',
|
||||
|
|
|
@ -6816,15 +6816,7 @@ fn (mut g Gen) type_default(typ_ ast.Type) string {
|
|||
}
|
||||
init_str += '.$field_name = $expr_str,'
|
||||
} else {
|
||||
mut zero_str := g.type_default(field.typ)
|
||||
if zero_str == '{0}' {
|
||||
if field_sym.info is ast.Struct {
|
||||
if field_sym.info.fields.len == 0
|
||||
&& field_sym.info.embeds.len == 0 {
|
||||
zero_str = '{0}'
|
||||
}
|
||||
}
|
||||
}
|
||||
zero_str := g.type_default(field.typ)
|
||||
init_str += '.$field_name = $zero_str,'
|
||||
}
|
||||
has_none_zero = true
|
||||
|
|
Loading…
Reference in New Issue