explicit void params declarations, add warnings to keep it correct

thx http://nickdesaulniers.github.io/blog/2019/05/12/f-vs-f-void-in-c-vs-c-plus-plus/
This commit is contained in:
cathugger
2019-05-14 20:29:27 +03:00
parent d03798bece
commit 92b36121b6
6 changed files with 28 additions and 10 deletions

View File

@@ -233,6 +233,23 @@ then
)
fi
CFLAGS="$cstd -Wmissing-prototypes -Werror"
AC_MSG_CHECKING([whether CC supports -Wmissing-prototypes])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[cstd="$cstd -Wmissing-prototypes"],
[AC_MSG_RESULT([no])]
)
# XXX AC_LANG_PROGRAM produces unsuitable prototype so this check must be last one
CFLAGS="$cstd -Wstrict-prototypes -Werror"
AC_MSG_CHECKING([whether CC supports -Wstrict-prototypes])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])],
[AC_MSG_RESULT([yes])]
[cstd="$cstd -Wstrict-prototypes"],
[AC_MSG_RESULT([no])]
)
CFLAGS="$oldcflags"
AC_ARG_ENABLE([binfilterlen],