compilation problem warn_unused_result [-Wunused-result]
Hello, I've got the following error when trying to build:
$ autoconf $ ./configure ... $ make make[1]: Entering directory '/home/bial/src/lux/src' "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux.erl "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_debug.erl "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_html.erl "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_interpret.erl "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_log.erl "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_suite.erl "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_tap.erl "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_parse.erl "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_shell.erl "/home/bial/tailf/ncs-4.0/bin/erlc" +warnings_as_errors +warn_unused_vars +debug_info -o ../ebin lux_utils.erl sed -e "s/%VSN%/1.8.6/g" < lux.app.src > ../ebin/lux.app make[1]: Leaving directory '/home/bial/src/lux/src' make[1]: Entering directory '/home/bial/src/lux/c_src' gcc -o ../priv/bin/runpty -g -O2 -Wall runpty.c runpty.c: In function ‘main’: runpty.c:98:5: warning: ignoring return value of ‘setuid’, declared with attribute warn_unused_result [-Wunused-result] setuid(getuid()); ^ make[1]: Leaving directory '/home/bial/src/lux/c_src'
I workarounded it by adding '-Wno-unused-result' to CFLAGS in include.mk file at line 29 before invoking 'make'.
My system is Ubuntu 15.04 with the following build tools: gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2 autoconf 2.69 GNU Make 4.0
fix
(void)setuid(getuid());
does not seem to be working with latest gcc compiler http://stackoverflow.com/questions/11888594/ignoring-return-values-in-c
I had to change it to
if (setuid(getuid()));
Thanks. I have added your fix on the develop branch.
/Håkan
On Mon, May 23, 2016 at 11:55 AM, novakmi [email protected] wrote:
fix
(void)setuid(getuid());
does not seem to be working with latest gcc compiler http://stackoverflow.com/questions/11888594/ignoring-return-values-in-c
I had to change it to if (setuid(getuid()));
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/hawk/lux/issues/3#issuecomment-220937215