Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling with -prod (msvc) causes c error #22311

Closed
daansystems opened this issue Sep 25, 2024 · 1 comment · Fixed by #22320
Closed

compiling with -prod (msvc) causes c error #22311

daansystems opened this issue Sep 25, 2024 · 1 comment · Fixed by #22320
Assignees
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.

Comments

@daansystems
Copy link

daansystems commented Sep 25, 2024

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 felipensp added Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. labels Sep 26, 2024
@felipensp
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants