multi_struct redefinition when returning !(int, voidptr) result in an or block #17343
Labels
Bug
This tag is applied to issues which reports bugs.
Unit: cgen
Bugs/feature requests, that are related to the default C generating backend.
Describe the bug
when returning two values (an
int
,u32
or any and avoidptr
) in an or block, a second multi_return struct is created with the same values (in this casemulti_return_int_voidptr
) wich causes a redefinition error.Expected Behavior
the multi_return struct should not be recreated
Current Behavior
tcc error:
error: struct/union/enum already defined
Reproduction Steps
Possible Solution
probably a compiler bug.
Additional Information/Context
in the example, changing
val2
to an int type resolves the error, it just creates a warning because of the pointer to int conversion.V version
V 0.3.3 e066d1d
Environment details (OS name and version, etc.)
OS: linux, "Manjaro Linux"
Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
CC version: cc (GCC) 12.2.0
getwd: /home/uhrbaan/Documents/code/vulkan/learn_vk
vmodules: /home/uhrbaan/.vmodules
vroot: /home/uhrbaan/vlang/v
vexe: /home/uhrbaan/vlang/v/v
vexe mtime: 2023-02-16 19:20:09
is vroot writable: true
is vmodules writable: true
V full version: V 0.3.3 ef5be22.e066d1d
Git version: git version 2.39.0
Git vroot status: weekly.2023.07-14-ge066d1d3-dirty
.git/config present: true
thirdparty/tcc status: thirdparty-linux-amd64 12f392c3
The text was updated successfully, but these errors were encountered: