A slackbuild of nginx on current failed today due to a change in gcc this might be of interest to others who get an error message such as the one at the bottom of this post. I found the reason and a fix in an nginx bug report.
Quote:
Reason for compilation errors like these is that GCC 7 added (https://gcc.gnu.org/gcc-7/changes.html) a new -Wimplicit-fallthrough which generates a message for case statements that implicitly fallthrough to the next case.
|
Quote:
If needed, -Werror can be easily disabled with ./configure --with-cc-opt="-Wno-error".
|
Bug report at:
https://trac.nginx.org/nginx/ticket/1259 Error message:
Code:
<snipped>
src/core/ngx_murmurhash.c: In function 'ngx_murmur_hash2':
src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[2] << 16;
~~^~~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:38:5: note: here
case 2:
^~~~
src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
h ^= data[1] << 8;
~~^~~~~~~~~~~~~~~
src/core/ngx_murmurhash.c:40:5: note: here
case 1:
^~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:601: objs/src/core/ngx_murmurhash.o] Error 1
<snipped>
I have also passed this info on to the maintainer of the nginx slackbuild.