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

-autofree C compiler error #23527

Open
mike-ward opened this issue Jan 19, 2025 · 1 comment
Open

-autofree C compiler error #23527

mike-ward opened this issue Jan 19, 2025 · 1 comment
Labels
Autofree Bugs/feature requests, that are related to -autofree. Bug This tag is applied to issues which reports bugs.

Comments

@mike-ward
Copy link
Contributor

mike-ward commented Jan 19, 2025

Describe the bug

Receiving a C error when trying to compile https://github.com/mike-ward/lsv with -autofree

Reproduction Steps

git clone https://github.com/mike-ward/lsv.git
cd lsv
v -prod -autofree lsv -o bin/lsv

Expected Behavior

Successful build.

Current Behavior

╰─ ▶ v -prod -autofree lsv -o bin/lsv
================== C compilation error (from cc): ==============
cc: /tmp/v_501/lsv.01JHZT617Q1HEWNACNB4SWYPF9.tmp.c:4554:53: error: passing 'string' (aka 'struct string') to parameter of incompatible type 'string *' (aka 'struct string *'); take the address with &
cc:  4554 |                 int result = main__string_compare(/*autofree arg*/_arg_expr_main_string_compare_1_1383, /*autofree arg*/_arg_expr_main_string_compare_2_1383, _V_closure_ctx->options.sort_ignore_case);
cc:       |                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc:       |                                                                   &
cc: /tmp/v_501/lsv.01JHZT617Q1HEWNACNB4SWYPF9.tmp.c:3520:50: note: passing argument to parameter 'a' here
cc:  3520 | VV_LOCAL_SYMBOL int main__string_compare(string* a, string* b, bool ignore_case);
cc:       |                                                  ^
cc: /tmp/v_501/lsv.01JHZT617Q1HEWNACNB4SWYPF9.tmp.c:15947:47: error: use of undeclared identifier '_arg_expr_main_real_length_1_3749'
cc:  15947 |                 int _t2 = main__real_length(/*autofree arg*/_arg_expr_main_real_length_1_3749);
cc:        |                                                             ^
cc: /tmp/v_501/lsv.01JHZT617Q1HEWNACNB4SWYPF9.tmp.c:16490:47: error: expected expression
cc:  16490 | string _arg_expr_main_right_pad_end_1_10067 = }
... (the original output was 86 lines long, and was truncated to 12 lines)
================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
builder error:
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug, please report it using `v bug file.v`,
or goto https://github.com/vlang/v/issues/new/choose .
You can also use #help on Discord: https://discord.gg/vlang .

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.9 11c59cf

Environment details (OS name and version, etc.)

V full version V 0.4.9 da3112e.11c59cf
OS macos, macOS, 15.1.1, 24B91
Processor 8 cpus, 64bit, little endian, Apple M2
Memory 0.16GB/8GB
V executable /Users/mike/Documents/github/v/v
V last modified time 2025-01-19 16:20:10
V home dir OK, value: /Users/mike/Documents/github/v
VMODULES OK, value: /Users/mike/.vmodules
VTMP OK, value: /tmp/v_501
Current working dir OK, value: /Users/mike/Documents/github/lsv
Git version git version 2.48.0
V git status weekly.2025.1-88-g11c59cf8
.git/config present true
cc version Apple clang version 16.0.0 (clang-1600.0.26.6)
gcc version Apple clang version 16.0.0 (clang-1600.0.26.6)
clang version Apple clang version 16.0.0 (clang-1600.0.26.6)
tcc version tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7 (AArch64 Darwin)
tcc git status thirdparty-macos-arm64 713692d4
emcc version N/A
glibc version N/A

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.

@mike-ward mike-ward added the Bug This tag is applied to issues which reports bugs. label Jan 19, 2025
Copy link

Connected to Huly®: V_0.6-21955

@felipensp felipensp added the Autofree Bugs/feature requests, that are related to -autofree. label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Autofree Bugs/feature requests, that are related to -autofree. Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

2 participants