ITADN

Compiler warning: use of `mktemp` is dangerous

#956Openpmqs 创建于 2026-02-03
bug
P
pmqscommented
Just looking at the GitHub workflow output for gcc & clang on Ubuntu, I see ``` [ 57%] Linking C executable minigzip /usr/bin/ld: libminizip.a(mz_os_posix.c.o): in function `mz_os_get_temp_path': /home/runner/work/minizip-ng/minizip-ng/mz_os_posix.c:374:(.text+0x1023): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp' [ 57%] Built target minigzip_cli [ 60%] Building C object CMakeFiles/minizip_cli.dir/minizip.c.o [ 62%] Linking C executable minizip /usr/bin/ld: libminizip.a(mz_os_posix.c.o): in function `mz_os_get_temp_path': /home/runner/work/minizip-ng/minizip-ng/mz_os_posix.c:374:(.text+0x1023): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp' ``` Adding `-Werror` to the build would catch this type of thing automatically. Not sure if that is what you want here.
1 条评论