Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation problem warn_unused_result [-Wunused-result] #3

Open
attila-bial-cn opened this issue Sep 2, 2015 · 2 comments
Open

compilation problem warn_unused_result [-Wunused-result] #3

attila-bial-cn opened this issue Sep 2, 2015 · 2 comments

Comments

@attila-bial-cn
Copy link

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

@novakmi
Copy link

novakmi commented May 23, 2016

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()));

@hawk
Copy link
Owner

hawk commented May 23, 2016

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
#3 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants