lammertb / libhttp

Multi platform HTTP and HTTPS library
MIT License
958 stars 131 forks source link

Compilation Errors with GCC 8.3 #62

Open Digicrat opened 4 years ago

Digicrat commented 4 years ago

Compilation fails out of the box with GCC 8.3

src/httplib_error_string.c: In function ‘httplib_error_string’:
src/httplib_error_string.c:170:2: error: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Werror=unused-result]
  strerror_r( error_code, buf, buf_len );
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:149: obj/httplib_error_string.o] Error 1

Adding "-Wno-error=unused-result" to the Makefile is a quick-fix for this error, but doesn't resolve the underlying issue.

lammertb commented 4 years ago

Thanks for reporting. Which operating system does your development system running on? That make it easier for me to create a virtual machine with the same environment to simulate the error.

PinPhreek commented 4 years ago

I had this error as well, by simply using printf() in the sourcecode, I resolved the error but I think it was not a great solution. OS: Lubuntu 18.04 with newest updates I hope I could help.

0dysseas commented 4 years ago

Is there any update on the issue? I'm facing the same problem with gcc 7.5.0 on Ubuntu 18.04

lcsmuller commented 4 years ago

Facing the same issue with gcc 7.5.0 on Linux Mint 19.3