~vtorri


#115 muon bootstrap with cl.exe: warnings 20 days ago

Ticket created by ~vtorri on ~lattis/muon

here are the warnings that I get with cl.exe when using bootstrap.bat

C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github>bootstrap.bat build
amalgam.c
C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github\src\backend/common_args.c(441): warning C4113: 'iteration_result (__cdecl *)(workspace *,void *,compiler_language,obj)' est différent de 'obj_dict_iterator' dans les listes de paramètres
C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github\src\backend/ninja/rules.c(191): warning C4113: 'iteration_result (__cdecl *)(workspace *,void *,compiler_language,obj)' est différent de 'obj_dict_iterator' dans les listes de paramètres
C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github\src\backend/ninja/rules.c(274): warning C4113: 'iteration_result (__cdecl *)(workspace *,void *,compiler_language,uint32_t)' est différent de 'obj_dict_iterator' dans les listes de paramètres
C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github\src\backend/ninja/rules.c(393): warning C4113: 'iteration_result (__cdecl *)(workspace *,void *,compiler_language,obj)' est différent de 'obj_dict_iterator' dans les listes de paramètres
C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github\src\backend/ninja/rules.c(397): warning C4113: 'iteration_result (__cdecl *)(workspace *,void *,compiler_language,obj)' est différent de 'obj_dict_iterator' dans les listes de paramètres
C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github\src\lang/lexer.c(245): warning C4133: 'fonction' : types incompatibles - de 'token_type *' à 'uint32_t *'
C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github\src\lang/lexer.c(257): warning C4133: 'fonction' : types incompatibles - de 'token_type *' à 'uint32_t *'
C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github\src\machine_file.c(65): warning C4133: 'fonction' : types incompatibles - de 'machine_file_section *' à 'uint32_t *'
C:\Documents\msys2\home\vincent.torri\gitroot_64\muon_github\src\wrap.c(173): warning C4133: 'fonction' : types incompatibles - de 'wrap_type *' à 'uint32_t *'
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_io.h(509): warning C4142: 'lseek' : redéfinition bénigne du type

#114 muon fmt throws errors with some functions of python module a month ago

Comment by ~vtorri on ~lattis/muon

oups, analyze of course

#114 muon fmt throws errors with some functions of python module a month ago

Ticket created by ~vtorri on ~lattis/muon

C:/Documents/msys2/home/vincent.torri/gitroot_64/libxml2_gitlab/python/meson.build:18:14: error method get_install_dir not found on python_installation
18 |   message(py.get_install_dir())
                  ^
C:/Documents/msys2/home/vincent.torri/gitroot_64/libxml2_gitlab/python/meson.build:20:3: error method extension_module not found on python_installation
20 |   py.extension_module('libxml2mod', files(libxml2mod_src),
          ^

#102 strncasecmp() does not exist on Windows with cl.exe 2 months ago

Comment by ~vtorri on ~lattis/muon

is it fixed now ?

#112 ld used when linking on Windows with MSYS2, instead of gcc 2 months ago

Ticket created by ~vtorri on ~lattis/muon

error :

C:/Documents/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find subprojects/tinyjson/libtiny-json.a: No such file or directory

it's gcc which should be used

#111 compilation of muon fails with msys2 + mingw64 2 months ago

Ticket created by ~vtorri on ~lattis/muon

in compilers.c

  1. line 434, the list of compilers to test is first cl, then cc, then others
  2. line 392, compiler_detect_c_or_cpp() is called with cl as compiler
  3. line 207, run_cmd_arr() with binary being cl
  4. line 184, run_cmd() fails with error "command not found"
  5. run_cmd_ctx_destroy() is called with cnt_open equal to 0
  6. close_handle() is called in run_cmd.c, cnt_open is equal to 0 and abort() is called

#106 add a function which always prepend an option to the compiler/linker 2 months ago

Comment by ~vtorri on ~lattis/muon

compiler_cl_args_always() has been added, issue can be closed

#110 Windows: warning in log.c 2 months ago

Ticket created by ~vtorri on ~lattis/muon

even if it is not possible, the compiler sees esc_num as possibly uninitialized. Just define it to 0. Possible patch:

diff --git a/src/platform/windows/log.c b/src/platform/windows/log.c
index 6264acd9..e7ff3ce2 100644
--- a/src/platform/windows/log.c
+++ b/src/platform/windows/log.c
@@ -49,7 +49,7 @@ print_colorized(FILE *out, const char *s)
                const char *start = s;
                uint32_t len = 0;

-               uint32_t esc_num;
+               uint32_t esc_num = 0;
                for (; *s; ++s) {
                        WORD attr;
                        if (*s == '\033') {

#109 Windows: warning in fmt.c 2 months ago

Ticket created by ~vtorri on ~lattis/muon

../src/lang/fmt.c:1045:53: warning: logical 'or' of collectively exhaustive tests is always true [-Wlogical-op]
 1045 |                                 } else if (lval < 0 || lval > (long)UINT32_MAX) {
      |                                                     ^~

the problem is that on Windows, long is always a 4 bytes type, hence lval > (long)UINT32_MAX) is u.

To fixthis, I would use long long for lval, and strtoll().

possible patch:

diff --git a/src/lang/fmt.c b/src/lang/fmt.c
index c5278a35..cfe3cfc1 100644
--- a/src/lang/fmt.c
+++ b/src/lang/fmt.c
@@ -1038,11 +1038,11 @@ fmt_cfg_parse_cb(void *_ctx, struct source *src, const char *sect,
                        switch (keys[i].type) {
                        case type_uint: {
                                char *endptr = NULL;
-                               long lval = strtol(v, &endptr, 10);
+                               long long lval = strtoll(v, &endptr, 10);
                                if (*endptr) {
                                        error_messagef(src, line, 1, log_error, "unable to parse integer");
                                        return false;
-                               } else if (lval < 0 || lval > (long)UINT32_MAX) {
+                               } else if (lval < 0 || lval > (long long)UINT32_MAX) {
                                        error_messagef(src, line, 1, log_error, "integer outside of range 0-%u", UINT32_MAX);
                                        return false;
                                }

#107 Support for --cross-file 2 months ago

Comment by ~vtorri on ~lattis/muon

cross compilation is not supported yet.