lammertb / libcrc

Multi platform CRC library
MIT License
576 stars 247 forks source link

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

Closed garverp closed 6 years ago

garverp commented 7 years ago

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