Commit Graph

10 Commits

Author SHA1 Message Date
sommerfeld
ac07e85117 Enhanced format checking, mk II:
New option -Wno-format-extra-args : suppress warning for:
	printf("foo", bar);
since that isn't interesting from the POV of this audit, and it's more
common than most in some code.

also, do format args checking for
	printf(Aflag ? "format 1: %s" : "format 2: %s", bar);
albeit in a half-hearted way for now (just check the "then" case)
2000-10-05 13:08:57 +00:00
sommerfeld
ad8aa5a492 Enhanced format string checking.
If -Wformat is enabled, try harder to chase down compile-time constant
format strings.. capable of catching things like:
	const char foo[]="%s %d";
	printf(foo, 1, "2");

If the new option -Wnetbsd-format-audit (no, I don't like the name,
either) is enabled, complain about non-constant format strings we
can't verify.  In particular, for *v*printf-like functions (i.e.,
non-variadic functions which are passed a va_list), insist that the
format string come from a parameter declared as a format string
argument, so that functions which should be declared as printflike are
caught at compile time.
2000-10-04 19:21:28 +00:00
tron
c28b234bd7 Let "egcs" recognize strftime(3)'s "%F" conversion. Patch supplied by
NAKAJIMA Yoshihiro in PR bin/9487.
2000-02-27 22:41:22 +00:00
christos
20cde7d22e For now make the warning that we are passing a NULL format to printf
like functions, only a pedantic warning. This will allow us to fix the
err functions.
1999-06-07 02:48:00 +00:00
tv
d2833781e6 Merge egcs 1.1.2 conflicts. 1999-04-06 16:04:00 +00:00
tv
687193cf68 Resolve corn flakes. 1998-08-24 18:28:20 +00:00
tv
c8f252d3aa Add -Wno-format-y2k option to kill Y2K based strftime() warnings. Note
that -Wformat-y2k doesn't work on C, and doesn't do anything notable by
itself on C++ (use -Wformat).
1998-08-20 20:13:12 +00:00
tv
667decf81a Resolve conflicts, fix up c-common, and clean up import of egcs 1.1. 1998-08-16 20:41:00 +00:00
mrg
5e78440996 merge netbsd changes for gcc. pmax still missing. 1998-03-29 11:36:52 +00:00
mrg
d3c5e32f1d initial import of the egcs 1.0.2 compiler 1998-03-29 08:14:27 +00:00