Fail build when unused c code is detected

Motivation:

To keep our code clean we should fail the build when unused c code is detected.

Modifications:

- Add '-Wunused-variable' to build flags

Result:

Cleaner code.
This commit is contained in:
Norman Maurer 2016-12-12 14:26:33 +01:00 committed by Norman Maurer
parent cb139043f3
commit 5fec897ef7

View File

@ -199,7 +199,7 @@
<value>${linux.sendmmsg.support}${glibc.sendmmsg.support}</value>
<!-- If glibc and linux kernel are both not sufficient...then define the CFLAGS -->
<regex>.*IO_NETTY_SENDMSSG_NOT_FOUND.*</regex>
<replacement>CFLAGS=-O3 -DIO_NETTY_SENDMMSG_NOT_FOUND -Werror -fno-omit-frame-pointer</replacement>
<replacement>CFLAGS=-O3 -DIO_NETTY_SENDMMSG_NOT_FOUND -Werror -fno-omit-frame-pointer -Wunused-variable</replacement>
<failIfNoMatch>false</failIfNoMatch>
</configuration>
</execution>
@ -215,7 +215,7 @@
<value>${jni.compiler.args.cflags}</value>
<!-- If glibc and linux kernel are both not sufficient...then define the CFLAGS -->
<regex>^((?!CFLAGS=).)*$</regex>
<replacement>CFLAGS=-O3 -Werror -fno-omit-frame-pointer</replacement>
<replacement>CFLAGS=-O3 -Werror -fno-omit-frame-pointer -Wunused-variable</replacement>
<failIfNoMatch>false</failIfNoMatch>
</configuration>
</execution>