julia icon indicating copy to clipboard operation
julia copied to clipboard

Warnings while building Julia on Windows

Open gitboy16 opened this issue 1 year ago • 2 comments

Hi,

1/ When I build Julia (master) on Windows, I have the below warnings. I am not sure whether it is something to be worried about or not?

    CC src/runtime_intrinsics.o
    CC src/precompile.o
    CC src/jloptions.o
/cygdrive/c/home/usr/julia/src/jl_uv.c: In function 'walk_print_cb':
/cygdrive/c/home/usr/julia/src/jl_uv.c:44:12: warning: assignment to 'uv_os_fd_t' {aka 'void *'} from 'uv_pid_t' {aka 'int'} makes pointer from integer without a cast [-Wint-conversion]
   44 |         fd = uv_process_get_pid((uv_process_t*)h);
      |            ^
/cygdrive/c/home/usr/julia/src/jl_uv.c:48:19: warning: comparison between pointer and integer
   48 |     int npad = fd == -1 ? 0 : snprintf(NULL, 0, "%zd", (size_t)fd);
      |                   ^~
/cygdrive/c/home/usr/julia/src/jl_uv.c:53:12: warning: comparison between pointer and integer
   53 |     if (fd == -1)
      |            ^~
/cygdrive/c/home/usr/julia/src/jl_uv.c:56:30: warning: unknown conversion type character 'z' in format [-Wformat=]
   56 |         jl_safe_printf(" %s[%zd] %s%p->%p\n", type, (size_t)fd, pad, (void*)h, (void*)h->data);
      |                              ^
/cygdrive/c/home/usr/julia/src/jl_uv.c:56:35: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'long long unsigned int' [-Wformat=]
   56 |         jl_safe_printf(" %s[%zd] %s%p->%p\n", type, (size_t)fd, pad, (void*)h, (void*)h->data);
      |                                  ~^                 ~~~~~~~~~~
      |                                   |                 |
      |                                   char *            long long unsigned int
      |                                  %lld
/cygdrive/c/home/usr/julia/src/jl_uv.c:56:24: warning: too many arguments for format [-Wformat-extra-args]
   56 |         jl_safe_printf(" %s[%zd] %s%p->%p\n", type, (size_t)fd, pad, (void*)h, (void*)h->data);
      |                        ^~~~~~~~~~~~~~~~~~~~~
/cygdrive/c/home/usr/julia/src/jl_uv.c: In function 'wait_empty_func':
/cygdrive/c/home/usr/julia/src/jl_uv.c:65:29: warning: unknown conversion type character 'z' in format [-Wformat=]
   65 |     jl_safe_printf("\n[pid %zd] waiting for IO to finish:\n"
      |                             ^
/cygdrive/c/home/usr/julia/src/jl_uv.c:65:20: warning: too many arguments for format [-Wformat-extra-args]
   65 |     jl_safe_printf("\n[pid %zd] waiting for IO to finish:\n"
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CC src/mtarraylist.o
    CC src/threading.o
    CC src/scheduler.o
    CC src/stackwalk.o
    CC src/gc.o
    CC src/gc-debug.o
    CC src/gc-pages.o
    CC src/gc-stacks.o
    CC src/gc-alloc-profiler.o
/cygdrive/c/home/usr/julia/src/stackwalk.c: In function 'jl_print_task_backtraces':
/cygdrive/c/home/usr/julia/src/stackwalk.c:1170:49: warning: unknown conversion type character 'z' in format [-Wformat=]
 1170 |         jl_safe_printf("==== Thread %d created %zu live tasks\n",
      |                                                 ^
    CC src/gc-page-profiler.o
/cygdrive/c/home/usr/julia/src/stackwalk.c:1170:24: warning: too many arguments for format [-Wformat-extra-args]
 1170 |         jl_safe_printf("==== Thread %d created %zu live tasks\n",
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cygdrive/c/home/usr/julia/src/stackwalk.c:1195:45: warning: unknown conversion type character 'z' in format [-Wformat=]
 1195 |             jl_safe_printf("     ---- Task %zu (%p)\n", j + 1, t);
      |                                             ^
/cygdrive/c/home/usr/julia/src/stackwalk.c:1195:50: warning: format '%p' expects argument of type 'void *', but argument 2 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
 1195 |             jl_safe_printf("     ---- Task %zu (%p)\n", j + 1, t);
      |                                                 ~^      ~~~~~
      |                                                  |        |
      |                                                  void *   size_t {aka long long unsigned int}
      |                                                 %lld
/cygdrive/c/home/usr/julia/src/stackwalk.c:1195:28: warning: too many arguments for format [-Wformat-extra-args]
 1195 |             jl_safe_printf("     ---- Task %zu (%p)\n", j + 1, t);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/cygdrive/c/home/usr/julia/src/stackwalk.c:1204:49: warning: unknown conversion type character 'z' in format [-Wformat=]
 1204 |             jl_safe_printf("     ---- End task %zu\n", j + 1);
      |                                                 ^
/cygdrive/c/home/usr/julia/src/stackwalk.c:1204:28: warning: too many arguments for format [-Wformat-extra-args]
 1204 |             jl_safe_printf("     ---- End task %zu\n", j + 1);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
    CC src/method.o
    CC src/jlapi.o
    CC src/signal-handling.o

2/ I was not able to check whether it is normal or not to have these warning as I can't find the build log you use to build your version of Julia. Would you be able to point me in the right direction please?

3/ I was able to get rid of some of the warnings above by replacing %zu by %llu. Also I am not sure whether this is really a fix and also can't tell whether it would work for other platform other than Windows?

Thank you

gitboy16 avatar Jan 13 '24 07:01 gitboy16

A recent windows build log is here https://buildkite.com/julialang/julia-master/builds/36002#018f1e29-faad-4b6a-901d-1796c10a0e8d

Zentrik avatar Apr 27 '24 08:04 Zentrik

The linked PR should fix the above warnings, I would be grateful if someone can review it or provide feedback. Thank you. I also made another one to fix building warning on windows for file utf8.c

gitboy16 avatar Apr 27 '24 09:04 gitboy16