julia icon indicating copy to clipboard operation
julia copied to clipboard

Fix warning that appears on Windows build in utf8.c

Open gitboy16 opened this issue 1 year ago • 2 comments

gitboy16 avatar Apr 26 '24 12:04 gitboy16

Thank you for your contribution! May I ask what is the warning this fixes / why does this fix it?

fingolfin avatar May 23 '24 21:05 fingolfin

It fixes the following warning:

gcc -m64 -fasynchronous-unwind-tables -fno-tree-tail-merge -D_WIN32_WINNT=0x0502 -DJULIA_NUM_THREADS=1 -DHAVE_SSP=1 -std=gnu11 -pipe  -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -fno-gnu-unique -Wold-style-definition -Wstrict-prototypes -Wc++-compat -O3 -ggdb2 -falign-functions -momit-leaf-frame-pointer  -I/c/workdir/usr/include -I/c/workdir/usr/include -DJL_LIBRARY_EXPORTS_INTERNAL -DUTF8PROC_EXPORTS -Wall -Wno-strict-aliasing -fvisibility=hidden -Wpointer-arith -Wundef -DNDEBUG -DJL_NDEBUG -c /c/workdir/src/support/utf8.c -o /c/workdir/src/support/utf8.o
C:/workdir/src/support/utf8.c: In function 'u8_escape_wchar':
C:/workdir/src/support/utf8.c:401:42: warning: unknown conversion type character 'h' in format [-Wformat=]
  401 |         return snprintf(buf, sz, "\\x%.2hhx", (unsigned char)ch);
      |                                          ^
C:/workdir/src/support/utf8.c:401:34: warning: too many arguments for format [-Wformat-extra-args]
  401 |         return snprintf(buf, sz, "\\x%.2hhx", (unsigned char)ch);
      |                                  ^~~~~~~~~~~
make[2]: Leaving directory

You may find some information and explanation on stackoverflow:

https://stackoverflow.com/questions/10678124/mingw-gcc-unknown-conversion-type-character-h-snprintf

gitboy16 avatar May 23 '24 22:05 gitboy16

Closing in preference of https://github.com/JuliaLang/julia/pull/54804, but thank you for the contribution!

topolarity avatar Jun 17 '24 13:06 topolarity