Closed jgarte closed 2 years ago
Has anyone come across this error before?
I ran ./configure
and make
Hi
jgart @.***> wrote:
checking for C compiler... gcc checking whether C compiler works... yes checking whether compiler accepts -Werror=unknown-warning-option... no checking whether compiler accepts -Werror=unused-command-line-argument... no checking whether linker accepts -Werror=unknown-warning-option... no checking whether linker accepts -Werror=unused-command-line-argument... no checking whether compiler accepts -pipe... yes checking whether compiler accepts -O2... yes checking whether compiler accepts -ffunction-sections... yes checking whether compiler accepts -fdata-sections... yes checking whether linker accepts -Wl,--gc-sections... yes checking whether compiler accepts -fPIE... yes checking whether compiler accepts -fstack-protector-all... yes checking whether linker accepts -Wl,-z,now... yes checking whether linker accepts -Wl,-z,relro... yes checking whether linker accepts -pie... yes creating config.mk... done checking for pkg-config... yes checking for libcurses... checking for ncursesw... yes checking for libtermkey... yes checking for libtre... yes checking for liblua >= 5.2 ... checking for lua... yes checking for Lua statically linked liblpeg... checking for static lpeg... no checking for static lua5.3-lpeg... no checking for static lua5.2-lpeg... no checking for libacl... no checking for libselinux... no checking for memrchr... yes completing config.mk... done cp config.def.h config.h gcc -pipe -O2 -ffunction-sections -fdata-sections -fPIE -fstack-protector-all -I/gnu/store/836gnx090mh12p7dndi17w0sif5x37bi-libtermkey-0.22/include -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/gnu/store/zzkly5rbfvahwqgcs7crz0ilpi7x5g5p-ncurses-6.2/include -I/gnu/store/pnk3idr4wlahycv17zix3rm77w3x1fzc-tre-0.8.0/include -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_3 -DLUA_COMPAT_ALL -std=c99 -D_POSIX_C_SOURCE=200809L -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -DNDEBUG -D_FORTIFY_SOURCE=2 -DVERSION=\"v0.7\" -DHAVE_MEMRCHR=1 -DVIS_PATH=\"/usr/local/share/vis\" -DCONFIG_HELP=1 -DCONFIG_CURSES=1 -DCONFIG_LUA=1 -DCONFIG_LPEG=0 -DCONFIG_TRE=1 -DCONFIG_SELINUX=0 -DCONFIG_ACL=0 array.c buffer.c libutf.c main.c map.c sam.c text.c text-common.c text-io.c text-iterator.c text-motions.c text-objects.c text-util.c ui-terminal.c view.c vis.c vis-lua.c vis-marks.c vis-modes.c vis-motions.c vis-operators.c vis-prompt.c vis-registers.c vis-text-objects.c text-regex-tre.c -Wl,-z,now -Wl,-z,relro -Wl,--gc-sections -pie -L/gnu/store/836gnx090mh12p7dndi17w0sif5x37bi-libtermkey-0.22/lib -ltermkey -Wl,-rpath=/gnu/store/zzkly5rbfvahwqgcs7crz0ilpi7x5g5p-ncurses-6.2/lib -lncursesw -L/gnu/store/pnk3idr4wlahycv17zix3rm77w3x1fzc-tre-0.8.0/lib -ltre -llua -lm -ldl -lc -o vis text-io.c: In function ‘mkstempat’: text-io.c:245:3: warning: ignoring return value of ‘fchdir’, declared with attribute warn_unused_result [-Wunused-result] fchdir(cwd); ^~~~~~~~~~~ gcc -pipe -O2 -ffunction-sections -fdata-sections -fPIE -fstack-protector-all -std=c99 -D_POSIX_C_SOURCE=200809L -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -DNDEBUG -D_FORTIFY_SOURCE=2 -DVERSION=\"v0.7\" vis-menu.c -Wl,-z,now -Wl,-z,relro -lc -Wl,--gc-sections -pie -o vis-menu gcc -pipe -O2 -ffunction-sections -fdata-sections -fPIE -fstack-protector-all -std=c99 -D_POSIX_C_SOURCE=200809L -U_XOPEN_SOURCE -D_XOPEN_SOURCE=700 -DNDEBUG -D_FORTIFY_SOURCE=2 -DVERSION=\"v0.7\" vis-digraph.c -Wl,-z,now -Wl,-z,relro -lc -Wl,--gc-sections -pie -o vis-digraph
This looks like a warning (for a missing return value check). It looks to me like it compiled just fine (and the "vis"-binary should be there).
Cheers,
Silvan
@Shugyousha
Hi, yes. That's correct. Silly me! The binary is there, indeed. I got thrown off by the error.
Do you happen to know why that warning was emitted?
jgart @.***> wrote:
Do you happen to know why that warning was emitted?
Yes, it tells you right in the warning message:
text-io.c: In function ‘mkstempat’:
text-io.c:245:17: warning: ignoring return value of ‘fchdir’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
245 | fchdir(cwd);
| ^~~
in the file "text-io.c" on line 245 the code is calling the "fchdir"
function to change the working directory. According to the man page
(man fchdir
), the "fchdir" function returns -1 if it fails. The
warning is raised because the code is not checking this return value for
error.
Looking at the code, this will most likely not cause any issues and I'm not sure if a patch to fix this warning would be accepted (it may be though).
Cheers,
Silvan