Skip to content

C error building latest vls with clangΒ #27103

@squidink7

Description

@squidink7

Describe the bug

Attempting to compile the latest vls (https://github.com/vlang/vls) with -prod or -cc clang

Reproduction Steps

clone https://github.com/vlang/vls
v -cc clang .

Expected Behavior

VLS to build

Current Behavior

/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:14905:76: error: incompatible pointer types passing '_option_string *' (aka 'struct _option_string *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 14905 |         builtin___option_ok(&(string[]){ (string){.str=(byteptr)"", .is_lit=1} }, (_option_string*)&res, sizeof(string));
       |                                                                                   ^~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:15617:117: error: incompatible pointer types passing '_option_Array_main__WorkspaceFolder *' (aka 'struct _option_Array_main__WorkspaceFolder *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 15617 |         builtin___option_ok(&(Array_main__WorkspaceFolder[]){ builtin____new_array(0, 0, sizeof(main__WorkspaceFolder)) }, (_option_Array_main__WorkspaceFolder*)&res, sizeof(Array_main__WorkspaceFolder));
       |                                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:15631:24: error: incompatible pointer types passing 'byte (*)[32]' (aka 'unsigned char (*)[32]') to parameter of type 'array *' (aka 'struct array *') [-Wincompatible-pointer-types]
 15631 |                         builtin__array_free(&res.data);
       |                                             ^~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5804:33: note: passing argument to parameter 'a' here
 5804 | void builtin__array_free(array* a);
      |                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:15700:390: error: incompatible pointer types passing '_option_main__ClientCapabilities *' (aka 'struct _option_main__ClientCapabilities *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 15700 |         builtin___option_ok(&(main__ClientCapabilities[]){ (main__ClientCapabilities){.general = (_option_main__GeneralClientCapabilities){.state=2, .err=_const_none__, .data={E_STRUCT}},.window = (_option_main__WindowClientCapabilities){.state=2, .err=_const_none__, .data={E_STRUCT}},.workspace = (_option_main__WorkspaceClientCapabilities){.state=2, .err=_const_none__, .data={E_STRUCT}},} }, (_option_main__ClientCapabilities*)&res, sizeof(main__ClientCapabilities));
       |                                                                                                                                                                                                                                                                                                                                                                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:15879:243: error: incompatible pointer types passing '_option_main__Command *' (aka 'struct _option_main__Command *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 15879 |         builtin___option_ok(&(main__Command[]){ (main__Command){.title = (string){.str=(byteptr)"", .is_lit=1},.command = (string){.str=(byteptr)"", .is_lit=1},.arguments = (_option_Array_string){.state=2, .err=_const_none__, .data={E_STRUCT}},} }, (_option_main__Command*)&res, sizeof(main__Command));
       |                                                                                                                                                                                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:15971:87: error: incompatible pointer types passing '_option_Array_string *' (aka 'struct _option_Array_string *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 15971 |         builtin___option_ok(&(Array_string[]){ builtin____new_array(0, 0, sizeof(string)) }, (_option_Array_string*)&res, sizeof(Array_string));
       |                                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:16445:167: error: incompatible pointer types passing '_option_main__LSPRange *' (aka 'struct _option_main__LSPRange *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 16445 |         builtin___option_ok(&(main__LSPRange[]){ (main__LSPRange){.start = (main__Position){.line = 0,.__v_char = 0,},.end = (main__Position){.line = 0,.__v_char = 0,},} }, (_option_main__LSPRange*)&res, sizeof(main__LSPRange));
       |                                                                                                                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:16529:37: error: incompatible pointer types passing '_option_int *' (aka 'struct _option_int *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 16529 |         builtin___option_ok(&(int[]){ 0 }, (_option_int*)&res, sizeof(int));
       |                                            ^~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:17555:38: error: incompatible pointer types passing '_option_bool *' (aka 'struct _option_bool *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 17555 |         builtin___option_ok(&(bool[]){ 0 }, (_option_bool*)&res, sizeof(bool));
       |                                             ^~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:17768:192: error: incompatible pointer types passing '_option_main__GeneralClientCapabilities *' (aka 'struct _option_main__GeneralClientCapabilities *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 17768 |         builtin___option_ok(&(main__GeneralClientCapabilities[]){ (main__GeneralClientCapabilities){.position_encodings = (_option_Array_string){.state=2, .err=_const_none__, .data={E_STRUCT}},} }, (_option_main__GeneralClientCapabilities*)&res, sizeof(main__GeneralClientCapabilities));
       |                                                                                                                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:17842:121: error: incompatible pointer types passing '_option_main__WindowClientCapabilities *' (aka 'struct _option_main__WindowClientCapabilities *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 17842 |         builtin___option_ok(&(main__WindowClientCapabilities[]){ (main__WindowClientCapabilities){.work_done_progress = 0,} }, (_option_main__WindowClientCapabilities*)&res, sizeof(main__WindowClientCapabilities));
       |                                                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:17911:235: error: incompatible pointer types passing '_option_main__WorkspaceClientCapabilities *' (aka 'struct _option_main__WorkspaceClientCapabilities *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 17911 |         builtin___option_ok(&(main__WorkspaceClientCapabilities[]){ (main__WorkspaceClientCapabilities){.did_change_watched_files = (_option_main__DidChangeWatchedFilesClientCapabilities){.state=2, .err=_const_none__, .data={E_STRUCT}},} }, (_option_main__WorkspaceClientCapabilities*)&res, sizeof(main__WorkspaceClientCapabilities));
       |                                                                                                                                                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:20205:153: error: incompatible pointer types passing '_option_main__DidChangeWatchedFilesClientCapabilities *' (aka 'struct _option_main__DidChangeWatchedFilesClientCapabilities *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 20205 |         builtin___option_ok(&(main__DidChangeWatchedFilesClientCapabilities[]){ (main__DidChangeWatchedFilesClientCapabilities){.dynamic_registration = 0,} }, (_option_main__DidChangeWatchedFilesClientCapabilities*)&res, sizeof(main__DidChangeWatchedFilesClientCapabilities));
       |                                                                                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:20274:88: error: incompatible pointer types passing '_option_Array_int *' (aka 'struct _option_Array_int *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 20274 |         builtin___option_ok(&(Array_int[]){ builtin____new_array_noscan(0, 0, sizeof(int)) }, (_option_Array_int*)&res, sizeof(Array_int));
       |                                                                                               ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:20750:191: error: incompatible pointer types passing '_option_main__ServerInfo *' (aka 'struct _option_main__ServerInfo *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 20750 |         builtin___option_ok(&(main__ServerInfo[]){ (main__ServerInfo){.name = (string){.str=(byteptr)"", .is_lit=1},.version = (_option_string){.state=2, .err=_const_none__, .data={E_STRUCT}},} }, (_option_main__ServerInfo*)&res, sizeof(main__ServerInfo));
       |                                                                                                                                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:20914:119: error: incompatible pointer types passing '_option_Array_main__TextDocumentEdit *' (aka 'struct _option_Array_main__TextDocumentEdit *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 20914 |         builtin___option_ok(&(Array_main__TextDocumentEdit[]){ builtin____new_array(0, 0, sizeof(main__TextDocumentEdit)) }, (_option_Array_main__TextDocumentEdit*)&res, sizeof(Array_main__TextDocumentEdit));
       |                                                                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:20928:24: error: incompatible pointer types passing 'byte (*)[32]' (aka 'unsigned char (*)[32]') to parameter of type 'array *' (aka 'struct array *') [-Wincompatible-pointer-types]
 20928 |                         builtin__array_free(&res.data);
       |                                             ^~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5804:33: note: passing argument to parameter 'a' here
 5804 | void builtin__array_free(array* a);
      |                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:22654:230: error: incompatible pointer types passing '_option_main__OnTypeFormattingOptions *' (aka 'struct _option_main__OnTypeFormattingOptions *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 22654 |         builtin___option_ok(&(main__OnTypeFormattingOptions[]){ (main__OnTypeFormattingOptions){.first_trigger_character = (string){.str=(byteptr)"", .is_lit=1},.more_trigger_characters = builtin____new_array(0, 0, sizeof(string)),} }, (_option_main__OnTypeFormattingOptions*)&res, sizeof(main__OnTypeFormattingOptions));
       |                                                                                                                                                                                                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:22974:363: error: incompatible pointer types passing '_option_main__WorkspaceEdit *' (aka 'struct _option_main__WorkspaceEdit *') to parameter of type '_option *' (aka 'struct _option *') [-Wincompatible-pointer-types]
 22974 |         builtin___option_ok(&(main__WorkspaceEdit[]){ (main__WorkspaceEdit){.changes = builtin__new_map(sizeof(string), sizeof(Array_main__TextEdit), &builtin__map_hash_string, &builtin__map_eq_string, &builtin__map_clone_string, &builtin__map_free_string),.document_changes = (_option_Array_main__TextDocumentEdit){.state=2, .err=_const_none__, .data={E_STRUCT}},} }, (_option_main__WorkspaceEdit*)&res, sizeof(main__WorkspaceEdit));
       |                                                                                                                                                                                                                                                                                                                                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/v_1000/vls.01KQZY5QBTMT26SVFFRMG6K8EH.tmp.c:5891:49: note: passing argument to parameter 'option' here
 5891 | void builtin___option_ok(voidptr data, _option* option, int size);
      |                                                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Possible Solution

No response

Additional Information/Context

No response

V version

master

Environment details (OS name and version, etc.)

V full version V 0.5.1 1b3385c.855bac3
OS linux, "Linux"
Processor 12 cpus, 64bit, little endian, AMD Ryzen 5 7640U w/ Radeon 760M Graphics
Memory 5.08GB/14.93GB
V executable /home/sirsegv/.v/v
V last modified time 2026-05-07 00:40:39
V home dir OK, value: /home/sirsegv/.v
VMODULES OK, value: /home/sirsegv/.vmodules
VTMP OK, value: /tmp/v_1000
Current working dir OK, value: /tmp/sirsegv/vls
Git version git version 2.53.0
V git status 0.5.1-1488-g855bac31
.git/config present true
cc version clang version 22.1.3
gcc version gcc (GCC) 15.2.1 20260209
clang version clang version 22.1.3
tcc version tcc version 0.9.28rc 2025-02-13 HEAD@f8bd136d (x86_64 Linux)
tcc git status thirdparty-linux-amd64 696c1d84
emcc version N/A
glibc version ldd (GNU libc) 2.43

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions