+2001-10-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-format.c (CPLUSPLUS_STD_VER): Define to STD_C94.
+
2001-10-01 Jim Wilson <wilson@redhat.com>
* sched-deps.c (add_dependence): When elide conditional dependence,
/* The C standard version C++ is treated as equivalent to
or inheriting from, for the purpose of format features supported. */
-#define CPLUSPLUS_STD_VER STD_C89
+#define CPLUSPLUS_STD_VER STD_C94
/* The C standard version we are checking formats against when pedantic. */
#define C_STD_VER ((int)(c_language == clk_cplusplus \
? CPLUSPLUS_STD_VER \
+2001-10-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * g++.dg/warn/format1.C: New test.
+
2001-10-01 Neil Booth <neil@daikokuya.demon.co.uk>
* mi6.c, mi6a.h, mi6b.h, mi6c.h, mi6d.h, mi6e.h: Correct tests.
--- /dev/null
+// Test that formats get checked according to C94.
+// Origin: Joseph Myers <jsm28@cam.ac.uk>.
+// { dg-do compile }
+// { dg-options "-ansi -pedantic -Wformat" }
+
+#include <cstdio>
+
+void
+foo (int i, int *ip, __WINT_TYPE__ lc, wchar_t *ls)
+{
+ std::printf ("%d%ls%lc\n", i, ls, lc);
+ std::printf ("%d", ls); // { dg-warning "format" "printf warning" }
+ std::scanf ("%d%lc%ls%l[abc]", ip, ls, ls, ls);
+ std::scanf ("%hd", ip); // { dg-warning "format" "scanf warning" }
+}