strace/m4/st_warn_cflags.m4
Dmitry V. Levin 0b03de74bc build: prepare for -Wimplicit-fallthrough=5
* gcc_compat.h (ATTRIBUTE_FALLTHROUGH): New macro.
* block.c (block_ioctl): Use it instead of "fall through" comment.
* btrfs.c (btrfs_ioctl): Likewise.
* loop.c (loop_ioctl): Likewise.
* mtd.c (mtd_ioctl): Likewise.
* rtc.c (rtc_ioctl): Likewise.
* v4l2.c (v4l2_ioctl): Likewise.
* dm.c (dm_decode_values): Likewise.
* process.c (SYS_FUNC(ptrace)): Likewise.
* quota.c (decode_cmd_data): Likewise.
* ucopy.c (umovestr): Likewise.
* unwind.c (unwind_print_stacktrace, unwind_capture_stacktrace)):
Likewise.
* term.c (term_ioctl): Add ATTRIBUTE_FALLTHROUGH.
* ioctl.c (ioctl_decode) [ALPHA || POWERPC]: Likewise.
* m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wimplicit-fallthrough=5.
* tests/ioctl_v4l2.c (init_v4l2_format): Reorganize the switch statement
without implicit fallthrough.
2018-03-06 23:52:08 +00:00

26 lines
768 B
Plaintext

AC_DEFUN([st_WARN_CFLAGS], [dnl
gl_WARN_ADD([-Wall])
gl_WARN_ADD([-Wempty-body])
gl_WARN_ADD([-Wformat-security])
gl_WARN_ADD([-Wignored-qualifiers])
gl_WARN_ADD([-Wimplicit-fallthrough=5])
gl_WARN_ADD([-Winit-self])
gl_WARN_ADD([-Wlogical-op])
gl_WARN_ADD([-Wmissing-parameter-type])
gl_WARN_ADD([-Wnested-externs])
gl_WARN_ADD([-Wold-style-declaration])
gl_WARN_ADD([-Wold-style-definition])
gl_WARN_ADD([-Wsign-compare])
gl_WARN_ADD([-Wtype-limits])
gl_WARN_ADD([-Wwrite-strings])
AC_ARG_ENABLE([gcc-Werror],
[AS_HELP_STRING([--enable-gcc-Werror], [turn on gcc's -Werror option])],
[case $enableval in
yes) gl_WARN_ADD([-Werror]) ;;
no) ;;
*) AC_MSG_ERROR([bad value $enableval for gcc-Werror option]) ;;
esac]
)
AC_SUBST([WARN_CFLAGS])
])