From: Adrian R. <ad...@an...> - 2019-06-15 12:48:34
|
Hi Lloyd On Sat, 15 Jun 2019, llo...@ya... wrote: > # DEBUGFLAGS = -Wall -Wextra -Wconversion -pedantic -ansi > > The -ansi flag caused SaVi to segfault on writing to the geomview pipe > with recent gcc, removing that flag fixed it. But why? gcc 7.3 or later If you look at the build warnings you will see gv_utils.c: In function ‘gv_stream_init_proc’: gv_utils.c:93:11: warning: implicit declaration of function ‘fileno’; did you mean ‘fopen’? [-Wimplicit-function-declaration] fdout = fileno(stdout); ^~~~~~ fopen It appears that the solution is to define _POSIX_C_SOURCE, e.g. make CC="gcc -Wall -Wextra -Wconversion -pedantic -ansi -D_POSIX_C_SOURCE" ARCH=ubuntu The resulting binary then runs correctly. See here for some explanation https://stackoverflow.com/questions/25759672/ansi-c-and-temporary-files Adrian. -- Adrian Rossiter ad...@an... http://antiprism.com/adrian |