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

Fix compile error on GCC 5.4.0 (Ubuntu 16.04.1 LTS) #2

Merged
merged 1 commit into from
Nov 10, 2017

Conversation

garverp
Copy link
Contributor

@garverp garverp commented Jul 7, 2017

This PR fixes compilation with GCC 5.4.0, which ships with Ubuntu 16.04.1 LTS. The compiler warns about fgets() not returning a value, and since warnings are treated as errors, the compilation fails.

cc -c -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wnested-externs -Werror -O3 -funsigned-char -Iinclude/ -oexamples/obj/tstcrc.o examples/tstcrc.c
examples/tstcrc.c: In function ‘main’:
examples/tstcrc.c:102:3: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]
fgets( input_string, MAX_STRING_SIZE-1, stdin );
^

…ile error because warnings are treated as errors in the default Makefile. Otherwise, need -Wno-unused-result to compile on gcc 5.4.0
Copy link
Owner

@lammertb lammertb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Committed. Thanks for your contribution!

@lammertb lammertb merged commit adf4ffe into lammertb:master Nov 10, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants