diff --git a/vlib/json/json_decode_with_optional_arg_test.v b/vlib/json/json_decode_with_optional_arg_test.v index 3aba409bf1..97b4932b8b 100644 --- a/vlib/json/json_decode_with_optional_arg_test.v +++ b/vlib/json/json_decode_with_optional_arg_test.v @@ -1,9 +1,7 @@ import json import os -struct DbConfig { - foo int -} +struct DbConfig {} fn test_json_decode_with_optional_arg() { if ret := print_info() { diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 7cc472feb7..6b2006d474 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -972,7 +972,7 @@ fn (g Gen) optional_type_text(styp string, base string) string { ret := 'struct $styp { byte state; IError err; - byte data[sizeof($size)]; + byte data[sizeof($size) > 0 ? sizeof($size) : 1]; }' return ret }