From 528764014083761890514818ced5de582c3b8bc0 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sun, 11 May 2025 22:38:50 +0200 Subject: [PATCH] Fix link --- README.md | 8 ++++---- src/compiler/linker.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e75d49c9b..58db307e3 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ for programmers who like C. Precompiled binaries for the following operating systems are available: -- Windows x64 [download](https://github.com/c3lang/c3c/releases/download/latest/c3-windows.zip), [install instructions](#installing-on-windows-with-precompiled-binaries). -- Debian x64 [download](https://github.com/c3lang/c3c/releases/download/latest/c3-linux.tar.gz), [install instructions](#installing-on-debian-with-precompiled-binaries). -- Ubuntu x86 [download](https://github.com/c3lang/c3c/releases/download/latest/c3-ubuntu-20.tar.gz), [install instructions](#installing-on-ubuntu-with-precompiled-binaries). -- MacOS Arm64 [download](https://github.com/c3lang/c3c/releases/download/latest/c3-macos.zip), [install instructions](#installing-on-macos-with-precompiled-binaries). +- Windows x64 [download](https://github.com/c3lang/c3c/releases/latest/download/c3-windows.zip), [install instructions](#installing-on-windows-with-precompiled-binaries). +- Debian x64 [download](https://github.com/c3lang/c3c/releases/latest/download/c3-linux.tar.gz), [install instructions](#installing-on-debian-with-precompiled-binaries). +- Ubuntu x86 [download](https://github.com/c3lang/c3c/releases/latest/download/c3-ubuntu-20.tar.gz), [install instructions](#installing-on-ubuntu-with-precompiled-binaries). +- MacOS Arm64 [download](https://github.com/c3lang/c3c/releases/latest/download/c3-macos.zip), [install instructions](#installing-on-macos-with-precompiled-binaries). The manual for C3 can be found at [www.c3-lang.org](http://www.c3-lang.org). diff --git a/src/compiler/linker.c b/src/compiler/linker.c index bba19f25c..29be6511a 100644 --- a/src/compiler/linker.c +++ b/src/compiler/linker.c @@ -19,7 +19,7 @@ const char *concat_file_arg = "/"; #define add_concat_quote_arg(arg_, arg2_) do { vec_add(*args_ref, concat_quote_arg); vec_add(*args_ref, (arg_)); vec_add(*args_ref, (arg2_)); } while(0) static char *assemble_linker_command(const char **args, bool extra_quote); -static unsigned assemble_link_arguments(const char **arguments, unsigned len); +static int assemble_link_arguments(const char **arguments, unsigned len); static inline bool is_no_pie(RelocModel reloc) { @@ -135,7 +135,7 @@ static void linker_setup_windows(const char ***args_ref, Linker linker_type, con if (compiler.build.win.vs_dirs) { char *c = strstr(compiler.build.win.vs_dirs, ";"); - int len = c - compiler.build.win.vs_dirs; + int len = (int)(c - compiler.build.win.vs_dirs); if (!c || !len) error_exit("''win-vs-dirs' override was invalid."); char *um = str_printf("%.*s\\um\\x64", len, compiler.build.win.vs_dirs); char *ucrt = str_printf("%.*s\\ucrt\\x64", len, compiler.build.win.vs_dirs); @@ -793,9 +793,9 @@ Linker linker_find_linker_type(void) UNREACHABLE } -static unsigned assemble_link_arguments(const char **arguments, unsigned len) +static int assemble_link_arguments(const char **arguments, unsigned len) { - unsigned count = 0; + int count = 0; for (unsigned i = 0; i < len ; i++) { const char *arg = arguments[i]; @@ -840,7 +840,7 @@ static bool link_exe(const char *output_file, const char **files_to_link, unsign bool success; #if LLVM_AVAILABLE - unsigned count = assemble_link_arguments(args, vec_size(args)); + int count = assemble_link_arguments(args, vec_size(args)); switch (compiler.platform.object_format) { case OBJ_FORMAT_COFF: @@ -1079,7 +1079,7 @@ bool dynamic_lib_linker(const char *output_file, const char **files, unsigned fi bool success; const char *error = NULL; #if LLVM_AVAILABLE - unsigned count = assemble_link_arguments(args, vec_size(args)); + int count = assemble_link_arguments(args, vec_size(args)); switch (compiler.platform.object_format) { case OBJ_FORMAT_COFF: