compiling with -prod (msvc) causes c error
Closed this issue · 1 comments
daansystems commented
V doctor:
V full version: V 0.4.7 18eee34.e974460
OS: windows, Microsoft Windows 11 Pro v22631 64-bit
Processor: 24 cpus, 64bit, little endian,
getwd: D:\vbug
vexe: C:\v\v.exe
vexe mtime: 2024-09-24 19:27:43
vroot: OK, value: C:\v
VMODULES: OK, value: C:\Users\info\.vmodules
VTMP: OK, value: C:\Users\info\AppData\Local\Temp\v_0
Git version: git version 2.42.0.windows.2
Git vroot status: weekly.2024.39-13-g4248fc55-dirty
.git/config present: true
CC version: Error: 'cc' is not recognized as an internal or external command,
operable program or batch file.
thirdparty/tcc status: thirdparty-windows-amd64 b425ac82
What did you do?
./v -g -o vdbg cmd/v && ./vdbg src\main.v
module main
pub type Mat4 = [16]f32
interface IGameObject {
world_transform() Mat4
}
fn main() {}
What did you expect to see?
prod version compiles correctly
What did you see instead?
D:\vbug>v -prod .
Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34120 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
cl -w /we4013 /volatile:ms /Fo"C:\Users\info\AppData\Local\Temp\v_0\vbug.01J8N3KKN61F7E84076S1B35ZD.tmp.c.obj" /F 16777216 /O2 /MD /DNDEBUG "C:\Users\info\AppData\Local\Temp\v_0\vbug.01J8N3KKN61F7E84076S1B35ZD.tmp.c" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt" -I "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared" /DGC_NOT_DLL=1 /DGC_WIN32_THREADS=1 /DGC_THREADS=1 -I "C:\v\thirdparty\libatomic_ops" -I "C:\v\thirdparty\libgc\include" "C:\v/thirdparty/libatomic_ops/atomic_ops.obj" "C:\v/thirdparty/libgc/gc.obj" ucrtd.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib dbghelp.lib user32.lib /link /NOLOGO /OUT:"D:\vbug\vbug.exe" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\X64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\X64" /LIBPATH:"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\lib\X64" /DEBUG:FULL /INCREMENTAL:NO /OPT:REF /OPT:ICF
vbug.01J8N3KKN61F7E84076S1B35ZD.tmp.c
C:\Users\info\AppData\Local\Temp\v_0\vbug.01J8N3KKN61F7E84076S1B35ZD.tmp.c(2263): error C2090: function returns array
builder error: msvc error
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
felipensp commented
Reproducible too with clang-17.
================== C compilation error (from clang-17): ==============
cc: /tmp/v_1000/bug.01J8NZNFDJ0MMB7D6VJV2WKQK2.tmp.c:2178:39: error: function cannot return array type 'main__Mat4' (aka 'float[16]')
cc: main__Mat4 (*_method_world_transform)(void* _);
cc: ^
cc: 1 error generated.