Failure to compile with flags Werror=unused-result and Werror=unused-but-set-variable
flounders opened this issue · comments
The affected files are libs/core/log/log.c, libs/common/error.c, libs/signet/keys.c. I adjusted the code to make it compile, but I am unsure that my code matches the intended behavior of the function. If you are interested I can submit a patch or pull request.
We're definitely interested in a pull request to see what it was that was broken.
Here is the pull request: #24
I just tried testing this again before closing the issue, but with the latest commit in the master branch it will not compile on line 245 of libs/common/error.c. The typecast to void does not seem to be taking care of compiler warning.
The develop branch no longer has this problem.
As a note, part of the issue here was that the GNU-specific version of strerror_r returns a char * instead of the integer specified by POSIX. We're now using autoconf to check and handle both cases. (The OS X build does not use the GNU version.)