The remaining ocurrences are genuine and intentional.
warning: format string is not a string literal [-Wformat-nonliteral]
# check_and_add_compiler_option(-Wcovered-switch-default)
check_and_add_compiler_option(-Wmissing-variable-declarations)
check_and_add_compiler_option(-Wunused-parameter)
+ check_and_add_compiler_option(-Wformat-nonliteral)
endif()
endif()
# AC_LBL_CHECK_COMPILER_OPT($1, -Wcovered-switch-default)
AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-variable-declarations)
AC_LBL_CHECK_COMPILER_OPT($1, -Wunused-parameter)
+ AC_LBL_CHECK_COMPILER_OPT($1, -Wformat-nonliteral)
fi
AC_LBL_CHECK_DEPENDENCY_GENERATION_OPT()
#
$as_echo "no" >&6; }
CFLAGS="$save_CFLAGS"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wformat-nonliteral option" >&5
+$as_echo_n "checking whether the compiler supports the -Wformat-nonliteral option... " >&6; }
+ save_CFLAGS="$CFLAGS"
+ if expr "x-Wformat-nonliteral" : "x-W.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wformat-nonliteral"
+ elif expr "x-Wformat-nonliteral" : "x-f.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror -Wformat-nonliteral"
+ elif expr "x-Wformat-nonliteral" : "x-m.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror -Wformat-nonliteral"
+ else
+ CFLAGS="$CFLAGS -Wformat-nonliteral"
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+return 0
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ CFLAGS="$save_CFLAGS"
+ V_CCOPT="$V_CCOPT -Wformat-nonliteral"
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$save_CFLAGS"
+
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{
u_int i;
int jt, jf;
- const char *ljerr = "%s for block-local relative jump: off=%d";
+ const char ljerr[] = "%s for block-local relative jump: off=%d";
#if 0
printf("code=%x off=%d %x %x\n", src->s.code,
static const char *program_name;
/* Forwards */
-static void PCAP_NORETURN error(const char *, ...);
+static void PCAP_NORETURN error(PCAP_FORMAT_STRING(const char *), ...) PCAP_PRINTFLIKE(1,2);
int
main(int argc, char **argv)
#include "pcap/funcattrs.h"
/* Forwards */
-static void PCAP_NORETURN error(const char *, ...);
+static void PCAP_NORETURN error(PCAP_FORMAT_STRING(const char *), ...) PCAP_PRINTFLIKE(1,2);
int
main(void)