summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-02-11 13:30:52 -0700
committerJens Axboe <axboe@kernel.dk>2019-02-11 13:30:52 -0700
commit71144e676e710b37966f447ccd8d944813dfa6d1 (patch)
treeca8f2a44ee20d14c0715bbac563037122fe85833 /configure
parent2401022342f650ac7d845a14c7b9bf1cd87cead6 (diff)
downloadfio-71144e676e710b37966f447ccd8d944813dfa6d1.tar.gz
fio-71144e676e710b37966f447ccd8d944813dfa6d1.tar.bz2
configure: enable -Wimplicit-fallthrough if we have it
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure17
1 files changed, 17 insertions, 0 deletions
diff --git a/configure b/configure
index c4fffd99..6e549cdc 100755
--- a/configure
+++ b/configure
@@ -2312,6 +2312,20 @@ if compile_prog "" "" "__kernel_rwf_t"; then
fi
print_config "__kernel_rwf_t" "$__kernel_rwf_t"
+##########################################
+# check if gcc has -Wimplicit-fallthrough
+fallthrough="no"
+cat > $TMPC << EOF
+int main(int argc, char **argv)
+{
+ return 0;
+}
+EOF
+if compile_prog "-Wimplicit-fallthrough" "" "-Wimplicit-fallthrough"; then
+ fallthrough="yes"
+fi
+print_config "-Wimplicit-fallthrough" "$fallthrough"
+
#############################################################################
if test "$wordsize" = "64" ; then
@@ -2583,6 +2597,9 @@ fi
if test "$__kernel_rwf_t" = "yes"; then
output_sym "CONFIG_HAVE_KERNEL_RWF_T"
fi
+if test "$fallthrough" = "yes"; then
+ CFLAGS="$CFLAGS -Wimplicit-fallthrough"
+fi
echo "LIBS+=$LIBS" >> $config_host_mak
echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak