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

C Error building lsv with -skip-unused #21907

Closed
mike-ward opened this issue Jul 22, 2024 · 0 comments · Fixed by #21914
Closed

C Error building lsv with -skip-unused #21907

mike-ward opened this issue Jul 22, 2024 · 0 comments · Fixed by #21914
Assignees
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@mike-ward
Copy link
Contributor

mike-ward commented Jul 22, 2024

Describe the bug

Trying to build project with -skip-unused option results in C error

Reproduction Steps

git clone https://github.com/mike-ward/lsv.git
cd lsv
make unused

Expected Behavior

Should create binary

Current Behavior

v -prod -skip-unused lsv -o bin/lsv
================== C compilation error (from cc): ==============
cc:                                                             ^
cc: /tmp/v_501/lsv.01J3D6Q6D7TV6ZCYMFPHJ8QKQK.tmp.c:15743:24: error: call to undeclared function 'array_sorted_with_compare'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
cc:                 _PUSH_MANY(&sorted, (array_sorted_with_compare(&(*(Array_main__Entry*)map_get((map*)&groups, &(string[]){key}, &(Array_main__Entry[]){ __new_array(0, 0, sizeof(main__Entry)) })), ((voidptr)(cmp)))), _t5, Array_main__Entry);
cc:                                      ^
cc: /tmp/v_501/lsv.01J3D6Q6D7TV6ZCYMFPHJ8QKQK.tmp.c:15743:202: error: initializing 'Array_main__Entry' (aka 'struct array') with an expression of incompatible type 'int'
cc:                 _PUSH_MANY(&sorted, (array_sorted_with_compare(&(*(Array_main__Entry*)map_get((map*)&groups, &(string[]){key}, &(Array_main__Entry[]){ __new_array(0, 0, sizeof(main__Entry)) })), ((voidptr)(cmp)))), _t5, Array_main__Entry);
cc:                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
cc: /tmp/v_501/lsv.01J3D6Q6D7TV6ZCYMFPHJ8QKQK.tmp.c:303:53: note: expanded from macro '_PUSH_MANY'
cc: #define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}
cc:                                                     ^     ~~~~~
cc: 22 warnings and 2 errors generated.
... (the original output was 82 lines long, and was truncated to 11 lines)
================================================================

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.6 d9a3a3a

Environment details (OS name and version, etc.)

V full version: V 0.4.6 8215f21.d9a3a3a
OS: macos, macOS, 14.5, 23F79
Processor: 8 cpus, 64bit, little endian, Apple M2

getwd: /Users/mike/Documents/github/lsv
vexe: /Users/mike/Documents/github/v/v
vexe mtime: 2024-07-22 12:26:39

vroot: OK, value: /Users/mike/Documents/github/v
VMODULES: OK, value: /Users/mike/.vmodules
VTMP: OK, value: /tmp/v_501

Git version: git version 2.45.2
Git vroot status: weekly.2024.28-45-gd9a3a3aa
.git/config present: true

CC version: Apple clang version 15.0.0 (clang-1500.3.9.4)
thirdparty/tcc status: thirdparty-macos-arm64 5c1d002f

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.

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.
Projects
None yet
3 participants