1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: avoid a compiler warning in generated code (#15394)

This commit is contained in:
Markus F.X.J. Oberhumer 2022-08-11 02:52:42 +02:00 committed by GitHub
parent 1c6366eb9c
commit 5095364838
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -987,7 +987,7 @@ fn (g Gen) optional_type_text(styp string, base string) string {
ret := 'struct $styp {
byte state;
IError err;
byte data[sizeof($size) > 0 ? sizeof($size) : 1];
byte data[sizeof($size) > 1 ? sizeof($size) : 1];
}'
return ret
}