freebsd-ports/lang/gcc295/files/patch-fc
David E. O'Brien 339e20ffc2 Add "-Wnon-const-format" which checks for non-constant format strings for
auditing purposes.

Submitted by:	kris
Obtained from:	NetBSD
2000-11-27 01:12:33 +00:00

31 lines
1.2 KiB
Text

--- gcc/toplev.c.orig Thu Oct 21 00:01:37 1999
+++ gcc/toplev.c Sun Nov 26 15:25:45 2000
@@ -771,6 +771,9 @@
int flag_no_ident = 0;
+/* Nonzero means that -Wformat accepts certain system-dependent formats. */
+int flag_format_extensions = 0;
+
/* Table of supported debugging formats. */
static struct
{
@@ -971,6 +974,8 @@
"Generate code to check every memory access" },
{"prefix-function-name", &flag_prefix_function_name, 1,
"Add a prefix to all function names" },
+ {"format-extensions", &flag_format_extensions, 1,
+ "-Wformat accepts certain FreeBSD system-dependent formats" },
{"dump-unnumbered", &flag_dump_unnumbered, 1,
"Suppress output of instruction numbers and line number notes in debugging dumps"},
{"instrument-functions", &flag_instrument_function_entry_exit, 1,
@@ -1051,7 +1056,9 @@
{ "-Wconversion", "Warn about possibly confusing type conversions" },
{ "-Wno-conversion", "" },
{ "-Wformat", "Warn about printf format anomalies" },
+ { "-Wnon-const-format", "Warn about printf-like format strings" },
{ "-Wno-format", "" },
+ { "-Wno-format-extra-args", "" },
{ "-Wimplicit-function-declaration",
"Warn about implicit function declarations" },
{ "-Wno-implicit-function-declaration", "" },