Commit f798660e by Joseph Myers Committed by Joseph Myers

c90-printf-1.c, [...]: Adjust warning regular expressions.

	* gcc.dg/c90-printf-1.c, gcc.dg/c90-printf-2.c,
	gcc.dg/c90-scanf-1.c, gcc.dg/c90-scanf-2.c, gcc.dg/c99-printf-1.c,
	gcc.dg/c99-scanf-1.c, gcc.dg/format-ext-1.c,
	gcc.dg/format-ext-2.c, gcc.dg/format-xopen-1.c,
	gcc.dg/formatz-1.c: Adjust warning regular expressions.

From-SVN: r36102
parent fcf1b822
2000-09-01 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.dg/c90-printf-1.c, gcc.dg/c90-printf-2.c,
gcc.dg/c90-scanf-1.c, gcc.dg/c90-scanf-2.c, gcc.dg/c99-printf-1.c,
gcc.dg/c99-scanf-1.c, gcc.dg/format-ext-1.c,
gcc.dg/format-ext-2.c, gcc.dg/format-xopen-1.c,
gcc.dg/formatz-1.c: Adjust warning regular expressions.
2000-09-01 Nathan Sidwell <nathan@codesourcery.com> 2000-09-01 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/nested4.C: New test. * g++.old-deja/g++.other/nested4.C: New test.
......
...@@ -79,30 +79,30 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p, ...@@ -79,30 +79,30 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
*/ */
printf ("%ho%hu%hx%hX", u, u, u, u); printf ("%ho%hu%hx%hX", u, u, u, u);
printf ("%hn", hn); printf ("%hn", hn);
printf ("%hf", d); /* { dg-warning "length character" "bad use of %h" } */ printf ("%hf", d); /* { dg-warning "length" "bad use of %h" } */
printf ("%he", d); /* { dg-warning "length character" "bad use of %h" } */ printf ("%he", d); /* { dg-warning "length" "bad use of %h" } */
printf ("%hE", d); /* { dg-warning "length character" "bad use of %h" } */ printf ("%hE", d); /* { dg-warning "length" "bad use of %h" } */
printf ("%hg", d); /* { dg-warning "length character" "bad use of %h" } */ printf ("%hg", d); /* { dg-warning "length" "bad use of %h" } */
printf ("%hG", d); /* { dg-warning "length character" "bad use of %h" } */ printf ("%hG", d); /* { dg-warning "length" "bad use of %h" } */
printf ("%hc", i); /* { dg-warning "length character" "bad use of %h" } */ printf ("%hc", i); /* { dg-warning "length" "bad use of %h" } */
printf ("%hs", s); /* { dg-warning "length character" "bad use of %h" } */ printf ("%hs", s); /* { dg-warning "length" "bad use of %h" } */
printf ("%hp", p); /* { dg-warning "length character" "bad use of %h" } */ printf ("%hp", p); /* { dg-warning "length" "bad use of %h" } */
printf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */ printf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */
printf ("%h."); /* { dg-warning "conversion" "bogus %h." } */ printf ("%h."); /* { dg-warning "conversion" "bogus %h." } */
printf ("%ld%li%lo%lu%lx%lX", l, l, ul, ul, ul, ul); printf ("%ld%li%lo%lu%lx%lX", l, l, ul, ul, ul, ul);
printf ("%ln", ln); printf ("%ln", ln);
printf ("%lf", d); /* { dg-warning "length character|C" "bad use of %l" } */ printf ("%lf", d); /* { dg-warning "length|C" "bad use of %l" } */
printf ("%le", d); /* { dg-warning "length character|C" "bad use of %l" } */ printf ("%le", d); /* { dg-warning "length|C" "bad use of %l" } */
printf ("%lE", d); /* { dg-warning "length character|C" "bad use of %l" } */ printf ("%lE", d); /* { dg-warning "length|C" "bad use of %l" } */
printf ("%lg", d); /* { dg-warning "length character|C" "bad use of %l" } */ printf ("%lg", d); /* { dg-warning "length|C" "bad use of %l" } */
printf ("%lG", d); /* { dg-warning "length character|C" "bad use of %l" } */ printf ("%lG", d); /* { dg-warning "length|C" "bad use of %l" } */
printf ("%lp", p); /* { dg-warning "length character|C" "bad use of %l" } */ printf ("%lp", p); /* { dg-warning "length|C" "bad use of %l" } */
/* These next two were added in C94, but should be objected to in C90. /* These next two were added in C94, but should be objected to in C90.
For the first one, GCC has wanted wchar_t instead of the correct C94 For the first one, GCC has wanted wchar_t instead of the correct C94
and C99 wint_t. and C99 wint_t.
*/ */
printf ("%lc", lc); /* { dg-warning "length character|C" "C90 bad use of %l" } */ printf ("%lc", lc); /* { dg-warning "length|C" "C90 bad use of %l" } */
printf ("%ls", ls); /* { dg-warning "length character|C" "C90 bad use of %l" } */ printf ("%ls", ls); /* { dg-warning "length|C" "C90 bad use of %l" } */
/* These uses of %L are legitimate, though GCC has wrongly warned for /* These uses of %L are legitimate, though GCC has wrongly warned for
them in the past. them in the past.
*/ */
...@@ -116,10 +116,10 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p, ...@@ -116,10 +116,10 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
printf ("%Lu", ull); /* { dg-warning "does not support" "bad use of %L" } */ printf ("%Lu", ull); /* { dg-warning "does not support" "bad use of %L" } */
printf ("%Lx", ull); /* { dg-warning "does not support" "bad use of %L" } */ printf ("%Lx", ull); /* { dg-warning "does not support" "bad use of %L" } */
printf ("%LX", ull); /* { dg-warning "does not support" "bad use of %L" } */ printf ("%LX", ull); /* { dg-warning "does not support" "bad use of %L" } */
printf ("%Lc", i); /* { dg-warning "length character" "bad use of %L" } */ printf ("%Lc", i); /* { dg-warning "length" "bad use of %L" } */
printf ("%Ls", s); /* { dg-warning "length character" "bad use of %L" } */ printf ("%Ls", s); /* { dg-warning "length" "bad use of %L" } */
printf ("%Lp", p); /* { dg-warning "length character" "bad use of %L" } */ printf ("%Lp", p); /* { dg-warning "length" "bad use of %L" } */
printf ("%Ln", n); /* { dg-warning "length character" "bad use of %L" } */ printf ("%Ln", n); /* { dg-warning "length" "bad use of %L" } */
/* Valid uses of each bare conversion. */ /* Valid uses of each bare conversion. */
printf ("%d%i%o%u%x%X%f%e%E%g%G%c%s%p%n%%", i, i, u, u, u, u, d, d, d, d, d, printf ("%d%i%o%u%x%X%f%e%E%g%G%c%s%p%n%%", i, i, u, u, u, u, d, d, d, d, d,
i, s, p, n); i, s, p, n);
......
...@@ -24,11 +24,11 @@ foo (int i, double d, llong ll, intmax_t j, size_t z, ptrdiff_t t) ...@@ -24,11 +24,11 @@ foo (int i, double d, llong ll, intmax_t j, size_t z, ptrdiff_t t)
{ {
/* Some tests already in c90-printf-1.c, e.g. %lf. */ /* Some tests already in c90-printf-1.c, e.g. %lf. */
/* The widths hh, ll, j, z, t are new. */ /* The widths hh, ll, j, z, t are new. */
printf ("%hhd", i); /* { dg-warning "length character|C" "%hh in C90" } */ printf ("%hhd", i); /* { dg-warning "length|C" "%hh in C90" } */
printf ("%lld", ll); /* { dg-warning "length character|C" "%ll in C90" } */ printf ("%lld", ll); /* { dg-warning "length|C" "%ll in C90" } */
printf ("%jd", j); /* { dg-warning "length character|C" "%j in C90" } */ printf ("%jd", j); /* { dg-warning "length|C" "%j in C90" } */
printf ("%zu", z); /* { dg-warning "length character|C" "%z in C90" } */ printf ("%zu", z); /* { dg-warning "length|C" "%z in C90" } */
printf ("%td", t); /* { dg-warning "length character|C" "%t in C90" } */ printf ("%td", t); /* { dg-warning "length|C" "%t in C90" } */
/* The formats F, a, A are new. */ /* The formats F, a, A are new. */
printf ("%F", d); /* { dg-warning "C" "%F in C90" } */ printf ("%F", d); /* { dg-warning "C" "%F in C90" } */
printf ("%a", d); /* { dg-warning "C" "%a in C90" } */ printf ("%a", d); /* { dg-warning "C" "%a in C90" } */
......
...@@ -53,24 +53,24 @@ foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp, ...@@ -53,24 +53,24 @@ foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp,
scanf ("%3n", n); /* { dg-warning "width" "width with %n" } */ scanf ("%3n", n); /* { dg-warning "width" "width with %n" } */
/* Valid and invalid %h, %l, %L constructions. */ /* Valid and invalid %h, %l, %L constructions. */
scanf ("%hd%hi%ho%hu%hx%hX%hn", hp, hp, uhp, uhp, uhp, uhp, hn); scanf ("%hd%hi%ho%hu%hx%hX%hn", hp, hp, uhp, uhp, uhp, uhp, hn);
scanf ("%he", fp); /* { dg-warning "length character" "bad use of %h" } */ scanf ("%he", fp); /* { dg-warning "length" "bad use of %h" } */
scanf ("%hE", fp); /* { dg-warning "length character" "bad use of %h" } */ scanf ("%hE", fp); /* { dg-warning "length" "bad use of %h" } */
scanf ("%hf", fp); /* { dg-warning "length character" "bad use of %h" } */ scanf ("%hf", fp); /* { dg-warning "length" "bad use of %h" } */
scanf ("%hg", fp); /* { dg-warning "length character" "bad use of %h" } */ scanf ("%hg", fp); /* { dg-warning "length" "bad use of %h" } */
scanf ("%hG", fp); /* { dg-warning "length character" "bad use of %h" } */ scanf ("%hG", fp); /* { dg-warning "length" "bad use of %h" } */
scanf ("%hs", s); /* { dg-warning "length character" "bad use of %h" } */ scanf ("%hs", s); /* { dg-warning "length" "bad use of %h" } */
scanf ("%h[ac]", s); /* { dg-warning "length character" "bad use of %h" } */ scanf ("%h[ac]", s); /* { dg-warning "length" "bad use of %h" } */
scanf ("%hc", s); /* { dg-warning "length character" "bad use of %h" } */ scanf ("%hc", s); /* { dg-warning "length" "bad use of %h" } */
scanf ("%hp", pp); /* { dg-warning "length character" "bad use of %h" } */ scanf ("%hp", pp); /* { dg-warning "length" "bad use of %h" } */
scanf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */ scanf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */
scanf ("%h."); /* { dg-warning "conversion" "bogus %h" } */ scanf ("%h."); /* { dg-warning "conversion" "bogus %h" } */
scanf ("%ld%li%lo%lu%lx%lX%ln", lp, lp, ulp, ulp, ulp, ulp, ln); scanf ("%ld%li%lo%lu%lx%lX%ln", lp, lp, ulp, ulp, ulp, ulp, ln);
scanf ("%le%lE%lf%lg%lG", dp, dp, dp, dp, dp); scanf ("%le%lE%lf%lg%lG", dp, dp, dp, dp, dp);
scanf ("%lp", pp); /* { dg-warning "length character" "bad use of %l" } */ scanf ("%lp", pp); /* { dg-warning "length" "bad use of %l" } */
/* These next three formats were added in C94. */ /* These next three formats were added in C94. */
scanf ("%ls", ls); /* { dg-warning "length character|C" "bad use of %l" } */ scanf ("%ls", ls); /* { dg-warning "length|C" "bad use of %l" } */
scanf ("%l[ac]", ls); /* { dg-warning "length character|C" "bad use of %l" } */ scanf ("%l[ac]", ls); /* { dg-warning "length|C" "bad use of %l" } */
scanf ("%lc", ls); /* { dg-warning "length character|C" "bad use of %l" } */ scanf ("%lc", ls); /* { dg-warning "length|C" "bad use of %l" } */
scanf ("%Le%LE%Lf%Lg%LG", ldp, ldp, ldp, ldp, ldp); scanf ("%Le%LE%Lf%Lg%LG", ldp, ldp, ldp, ldp, ldp);
scanf ("%Ld", llp); /* { dg-warning "does not support" "bad use of %L" } */ scanf ("%Ld", llp); /* { dg-warning "does not support" "bad use of %L" } */
scanf ("%Li", llp); /* { dg-warning "does not support" "bad use of %L" } */ scanf ("%Li", llp); /* { dg-warning "does not support" "bad use of %L" } */
...@@ -78,11 +78,11 @@ foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp, ...@@ -78,11 +78,11 @@ foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp,
scanf ("%Lu", ullp); /* { dg-warning "does not support" "bad use of %L" } */ scanf ("%Lu", ullp); /* { dg-warning "does not support" "bad use of %L" } */
scanf ("%Lx", ullp); /* { dg-warning "does not support" "bad use of %L" } */ scanf ("%Lx", ullp); /* { dg-warning "does not support" "bad use of %L" } */
scanf ("%LX", ullp); /* { dg-warning "does not support" "bad use of %L" } */ scanf ("%LX", ullp); /* { dg-warning "does not support" "bad use of %L" } */
scanf ("%Ls", s); /* { dg-warning "length character" "bad use of %L" } */ scanf ("%Ls", s); /* { dg-warning "length" "bad use of %L" } */
scanf ("%L[ac]", s); /* { dg-warning "length character" "bad use of %L" } */ scanf ("%L[ac]", s); /* { dg-warning "length" "bad use of %L" } */
scanf ("%Lc", s); /* { dg-warning "length character" "bad use of %L" } */ scanf ("%Lc", s); /* { dg-warning "length" "bad use of %L" } */
scanf ("%Lp", pp); /* { dg-warning "length character" "bad use of %L" } */ scanf ("%Lp", pp); /* { dg-warning "length" "bad use of %L" } */
scanf ("%Ln", n); /* { dg-warning "length character" "bad use of %L" } */ scanf ("%Ln", n); /* { dg-warning "length" "bad use of %L" } */
/* Valid uses of each bare conversion. */ /* Valid uses of each bare conversion. */
scanf ("%d%i%o%u%x%X%e%E%f%g%G%s%[abc]%c%p%n%%", ip, ip, uip, uip, uip, scanf ("%d%i%o%u%x%X%e%E%f%g%G%s%[abc]%c%p%n%%", ip, ip, uip, uip, uip,
uip, fp, fp, fp, fp, fp, s, s, s, pp, n); uip, fp, fp, fp, fp, fp, s, s, s, pp, n);
......
...@@ -25,11 +25,11 @@ foo (signed char *hhp, float *fp, llong *llp, intmax_t *jp, ...@@ -25,11 +25,11 @@ foo (signed char *hhp, float *fp, llong *llp, intmax_t *jp,
{ {
/* Some tests already in c90-scanf-1.c. */ /* Some tests already in c90-scanf-1.c. */
/* The widths hh, ll, j, z, t are new. */ /* The widths hh, ll, j, z, t are new. */
scanf ("%hhd", hhp); /* { dg-warning "length character|C" "%hh in C90" } */ scanf ("%hhd", hhp); /* { dg-warning "length|C" "%hh in C90" } */
scanf ("%lld", llp); /* { dg-warning "length character|C" "%ll in C90" } */ scanf ("%lld", llp); /* { dg-warning "length|C" "%ll in C90" } */
scanf ("%jd", jp); /* { dg-warning "length character|C" "%j in C90" } */ scanf ("%jd", jp); /* { dg-warning "length|C" "%j in C90" } */
scanf ("%zu", zp); /* { dg-warning "length character|C" "%z in C90" } */ scanf ("%zu", zp); /* { dg-warning "length|C" "%z in C90" } */
scanf ("%td", tp); /* { dg-warning "length character|C" "%t in C90" } */ scanf ("%td", tp); /* { dg-warning "length|C" "%t in C90" } */
/* The formats F, a, A are new. */ /* The formats F, a, A are new. */
scanf ("%F", fp); /* { dg-warning "C" "%F in C90" } */ scanf ("%F", fp); /* { dg-warning "C" "%F in C90" } */
scanf ("%a", fp); /* { dg-warning "C" "%a in C90" } */ scanf ("%a", fp); /* { dg-warning "C" "%a in C90" } */
......
...@@ -24,44 +24,44 @@ foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll, ...@@ -24,44 +24,44 @@ foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll,
This is largely obsoleted in C99 by %j, %ll and PRId64. This is largely obsoleted in C99 by %j, %ll and PRId64.
*/ */
printf ("%qd%qi%qo%qu%qx%qX%qn", q, q, uq, uq, uq, uq, qn); printf ("%qd%qi%qo%qu%qx%qX%qn", q, q, uq, uq, uq, uq, qn);
printf ("%qf", d); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qf", d); /* { dg-warning "length" "bad use of %q" } */
printf ("%qF", d); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qF", d); /* { dg-warning "length" "bad use of %q" } */
printf ("%qe", d); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qe", d); /* { dg-warning "length" "bad use of %q" } */
printf ("%qE", d); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qE", d); /* { dg-warning "length" "bad use of %q" } */
printf ("%qg", d); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qg", d); /* { dg-warning "length" "bad use of %q" } */
printf ("%qG", d); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qG", d); /* { dg-warning "length" "bad use of %q" } */
printf ("%qa", d); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qa", d); /* { dg-warning "length" "bad use of %q" } */
printf ("%qA", d); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qA", d); /* { dg-warning "length" "bad use of %q" } */
printf ("%qc", i); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qc", i); /* { dg-warning "length" "bad use of %q" } */
printf ("%qs", s); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qs", s); /* { dg-warning "length" "bad use of %q" } */
printf ("%qp", p); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qp", p); /* { dg-warning "length" "bad use of %q" } */
printf ("%qC", lc); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qC", lc); /* { dg-warning "length" "bad use of %q" } */
printf ("%qS", ls); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qS", ls); /* { dg-warning "length" "bad use of %q" } */
/* With a bad length character GCC wants some argument, any argument, /* With a bad length GCC wants some argument, any argument,
to devour with the format conversion, as a synchronisation heuristic. to devour with the format conversion, as a synchronisation heuristic.
This may get improved later. This may get improved later.
*/ */
printf ("%qm", i); /* { dg-warning "length character" "bad use of %q" } */ printf ("%qm", i); /* { dg-warning "length" "bad use of %q" } */
/* As an extension, GCC allows the length "Z" as a synonym for "z". /* As an extension, GCC allows the length "Z" as a synonym for "z".
This was an extension predating C99 which should now be considered This was an extension predating C99 which should now be considered
deprecated; use the standard "z" instead. deprecated; use the standard "z" instead.
*/ */
printf ("%Zd%Zi%Zo%Zu%Zx%ZX", z, z, z, z, z, z); printf ("%Zd%Zi%Zo%Zu%Zx%ZX", z, z, z, z, z, z);
printf ("%Zn", zn); printf ("%Zn", zn);
printf ("%Zf", d); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%Zf", d); /* { dg-warning "length" "bad use of %Z" } */
printf ("%ZF", d); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%ZF", d); /* { dg-warning "length" "bad use of %Z" } */
printf ("%Ze", d); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%Ze", d); /* { dg-warning "length" "bad use of %Z" } */
printf ("%ZE", d); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%ZE", d); /* { dg-warning "length" "bad use of %Z" } */
printf ("%Zg", d); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%Zg", d); /* { dg-warning "length" "bad use of %Z" } */
printf ("%ZG", d); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%ZG", d); /* { dg-warning "length" "bad use of %Z" } */
printf ("%Za", d); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%Za", d); /* { dg-warning "length" "bad use of %Z" } */
printf ("%ZA", d); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%ZA", d); /* { dg-warning "length" "bad use of %Z" } */
printf ("%Zc", i); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%Zc", i); /* { dg-warning "length" "bad use of %Z" } */
printf ("%Zs", s); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%Zs", s); /* { dg-warning "length" "bad use of %Z" } */
printf ("%Zp", p); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%Zp", p); /* { dg-warning "length" "bad use of %Z" } */
printf ("%ZC", lc); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%ZC", lc); /* { dg-warning "length" "bad use of %Z" } */
printf ("%ZS", ls); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%ZS", ls); /* { dg-warning "length" "bad use of %Z" } */
printf ("%Zm", i); /* { dg-warning "length character" "bad use of %Z" } */ printf ("%Zm", i); /* { dg-warning "length" "bad use of %Z" } */
/* As an extension, GCC allows the length "L" on integer formats /* As an extension, GCC allows the length "L" on integer formats
(but not %n) as a synonym for "ll". (but not %n) as a synonym for "ll".
This should be considered deprecated. This should be considered deprecated.
...@@ -83,16 +83,16 @@ foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll, ...@@ -83,16 +83,16 @@ foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll,
printf ("%#m"); /* { dg-warning "flag" "bad %#m" } */ printf ("%#m"); /* { dg-warning "flag" "bad %#m" } */
printf ("%0m"); /* { dg-warning "flag" "bad %0m" } */ printf ("%0m"); /* { dg-warning "flag" "bad %0m" } */
printf ("%'m"); /* { dg-warning "flag" "bad %'m" } */ printf ("%'m"); /* { dg-warning "flag" "bad %'m" } */
printf ("%hm", i); /* { dg-warning "length character" "bad %hm" } */ printf ("%hm", i); /* { dg-warning "length" "bad %hm" } */
printf ("%hhm", i); /* { dg-warning "length character" "bad %hhm" } */ printf ("%hhm", i); /* { dg-warning "length" "bad %hhm" } */
printf ("%lm", i); /* { dg-warning "length character" "bad %lm" } */ printf ("%lm", i); /* { dg-warning "length" "bad %lm" } */
printf ("%llm", i); /* { dg-warning "length character" "bad %llm" } */ printf ("%llm", i); /* { dg-warning "length" "bad %llm" } */
printf ("%jm", i); /* { dg-warning "length character" "bad %jm" } */ printf ("%jm", i); /* { dg-warning "length" "bad %jm" } */
printf ("%zm", i); /* { dg-warning "length character" "bad %zm" } */ printf ("%zm", i); /* { dg-warning "length" "bad %zm" } */
printf ("%tm", i); /* { dg-warning "length character" "bad %tm" } */ printf ("%tm", i); /* { dg-warning "length" "bad %tm" } */
printf ("%Lm", i); /* { dg-warning "length character" "bad %Lm" } */ printf ("%Lm", i); /* { dg-warning "length" "bad %Lm" } */
printf ("%qm", i); /* { dg-warning "length character" "bad %qm" } */ printf ("%qm", i); /* { dg-warning "length" "bad %qm" } */
printf ("%Zm", i); /* { dg-warning "length character" "bad %Zm" } */ printf ("%Zm", i); /* { dg-warning "length" "bad %Zm" } */
/* As an extension, glibc includes the "I" flag for decimal integer /* As an extension, glibc includes the "I" flag for decimal integer
formats, to output using the locale's digits (e.g. in Arabic). formats, to output using the locale's digits (e.g. in Arabic).
In GCC, we require this to be in the standard place for flags, though In GCC, we require this to be in the standard place for flags, though
......
...@@ -21,20 +21,20 @@ foo (quad_t *qp, u_quad_t *uqp, quad_t *qn, long long int *llp, ...@@ -21,20 +21,20 @@ foo (quad_t *qp, u_quad_t *uqp, quad_t *qn, long long int *llp,
This is largely obsoleted in C99 by %j, %ll and SCNd64. This is largely obsoleted in C99 by %j, %ll and SCNd64.
*/ */
scanf ("%qd%qi%qo%qu%qx%qX%qn", qp, qp, uqp, uqp, uqp, uqp, qn); scanf ("%qd%qi%qo%qu%qx%qX%qn", qp, qp, uqp, uqp, uqp, uqp, qn);
scanf ("%qf", fp); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qf", fp); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qF", fp); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qF", fp); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qe", fp); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qe", fp); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qE", fp); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qE", fp); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qg", fp); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qg", fp); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qG", fp); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qG", fp); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qa", fp); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qa", fp); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qA", fp); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qA", fp); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qs", s); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qs", s); /* { dg-warning "length" "bad use of %q" } */
scanf ("%q[abc]", s); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%q[abc]", s); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qc", s); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qc", s); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qp", pp); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qp", pp); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qC", ls); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qC", ls); /* { dg-warning "length" "bad use of %q" } */
scanf ("%qS", ls); /* { dg-warning "length character" "bad use of %q" } */ scanf ("%qS", ls); /* { dg-warning "length" "bad use of %q" } */
/* As an extension, GCC allows the length "L" on integer formats /* As an extension, GCC allows the length "L" on integer formats
(but not %n) as a synonym for "ll". (but not %n) as a synonym for "ll".
This should be considered deprecated. This should be considered deprecated.
......
...@@ -25,14 +25,14 @@ foo (int i, unsigned int u, wint_t lc, wchar_t *ls, int *ip, double d, ...@@ -25,14 +25,14 @@ foo (int i, unsigned int u, wint_t lc, wchar_t *ls, int *ip, double d,
printf ("%C", lc); printf ("%C", lc);
printf ("%3C", lc); printf ("%3C", lc);
printf ("%.3C", lc); /* { dg-warning "precision" "precision with %C" } */ printf ("%.3C", lc); /* { dg-warning "precision" "precision with %C" } */
printf ("%hC", lc); /* { dg-warning "length character" "bad %hC" } */ printf ("%hC", lc); /* { dg-warning "length" "bad %hC" } */
printf ("%hhC", lc); /* { dg-warning "length character" "bad %hhC" } */ printf ("%hhC", lc); /* { dg-warning "length" "bad %hhC" } */
printf ("%lC", lc); /* { dg-warning "length character" "bad %lC" } */ printf ("%lC", lc); /* { dg-warning "length" "bad %lC" } */
printf ("%llC", lc); /* { dg-warning "length character" "bad %llC" } */ printf ("%llC", lc); /* { dg-warning "length" "bad %llC" } */
printf ("%jC", lc); /* { dg-warning "length character" "bad %jC" } */ printf ("%jC", lc); /* { dg-warning "length" "bad %jC" } */
printf ("%zC", lc); /* { dg-warning "length character" "bad %zC" } */ printf ("%zC", lc); /* { dg-warning "length" "bad %zC" } */
printf ("%tC", lc); /* { dg-warning "length character" "bad %tC" } */ printf ("%tC", lc); /* { dg-warning "length" "bad %tC" } */
printf ("%LC", lc); /* { dg-warning "length character" "bad %LC" } */ printf ("%LC", lc); /* { dg-warning "length" "bad %LC" } */
printf ("%-C", lc); printf ("%-C", lc);
printf ("%+C", lc); /* { dg-warning "flag" "bad %+C" } */ printf ("%+C", lc); /* { dg-warning "flag" "bad %+C" } */
printf ("% C", lc); /* { dg-warning "flag" "bad % C" } */ printf ("% C", lc); /* { dg-warning "flag" "bad % C" } */
...@@ -42,14 +42,14 @@ foo (int i, unsigned int u, wint_t lc, wchar_t *ls, int *ip, double d, ...@@ -42,14 +42,14 @@ foo (int i, unsigned int u, wint_t lc, wchar_t *ls, int *ip, double d,
printf ("%S", ls); printf ("%S", ls);
printf ("%3S", ls); printf ("%3S", ls);
printf ("%.3S", ls); printf ("%.3S", ls);
printf ("%hS", ls); /* { dg-warning "length character" "bad %hS" } */ printf ("%hS", ls); /* { dg-warning "length" "bad %hS" } */
printf ("%hhS", ls); /* { dg-warning "length character" "bad %hhS" } */ printf ("%hhS", ls); /* { dg-warning "length" "bad %hhS" } */
printf ("%lS", ls); /* { dg-warning "length character" "bad %lS" } */ printf ("%lS", ls); /* { dg-warning "length" "bad %lS" } */
printf ("%llS", ls); /* { dg-warning "length character" "bad %llS" } */ printf ("%llS", ls); /* { dg-warning "length" "bad %llS" } */
printf ("%jS", ls); /* { dg-warning "length character" "bad %jS" } */ printf ("%jS", ls); /* { dg-warning "length" "bad %jS" } */
printf ("%zS", ls); /* { dg-warning "length character" "bad %zS" } */ printf ("%zS", ls); /* { dg-warning "length" "bad %zS" } */
printf ("%tS", ls); /* { dg-warning "length character" "bad %tS" } */ printf ("%tS", ls); /* { dg-warning "length" "bad %tS" } */
printf ("%LS", ls); /* { dg-warning "length character" "bad %LS" } */ printf ("%LS", ls); /* { dg-warning "length" "bad %LS" } */
printf ("%-S", ls); printf ("%-S", ls);
printf ("%+S", ls); /* { dg-warning "flag" "bad %+S" } */ printf ("%+S", ls); /* { dg-warning "flag" "bad %+S" } */
printf ("% S", ls); /* { dg-warning "flag" "bad % S" } */ printf ("% S", ls); /* { dg-warning "flag" "bad % S" } */
...@@ -60,22 +60,22 @@ foo (int i, unsigned int u, wint_t lc, wchar_t *ls, int *ip, double d, ...@@ -60,22 +60,22 @@ foo (int i, unsigned int u, wint_t lc, wchar_t *ls, int *ip, double d,
scanf ("%S", ls); scanf ("%S", ls);
scanf ("%*C%*S"); scanf ("%*C%*S");
scanf ("%2C%3S", ls, ls); scanf ("%2C%3S", ls, ls);
scanf ("%hC", ls); /* { dg-warning "length character" "bad %hC" } */ scanf ("%hC", ls); /* { dg-warning "length" "bad %hC" } */
scanf ("%hhC", ls); /* { dg-warning "length character" "bad %hhC" } */ scanf ("%hhC", ls); /* { dg-warning "length" "bad %hhC" } */
scanf ("%lC", ls); /* { dg-warning "length character" "bad %lC" } */ scanf ("%lC", ls); /* { dg-warning "length" "bad %lC" } */
scanf ("%llC", ls); /* { dg-warning "length character" "bad %llC" } */ scanf ("%llC", ls); /* { dg-warning "length" "bad %llC" } */
scanf ("%jC", ls); /* { dg-warning "length character" "bad %jC" } */ scanf ("%jC", ls); /* { dg-warning "length" "bad %jC" } */
scanf ("%zC", ls); /* { dg-warning "length character" "bad %zC" } */ scanf ("%zC", ls); /* { dg-warning "length" "bad %zC" } */
scanf ("%tC", ls); /* { dg-warning "length character" "bad %tC" } */ scanf ("%tC", ls); /* { dg-warning "length" "bad %tC" } */
scanf ("%LC", ls); /* { dg-warning "length character" "bad %LC" } */ scanf ("%LC", ls); /* { dg-warning "length" "bad %LC" } */
scanf ("%hS", ls); /* { dg-warning "length character" "bad %hS" } */ scanf ("%hS", ls); /* { dg-warning "length" "bad %hS" } */
scanf ("%hhS", ls); /* { dg-warning "length character" "bad %hhS" } */ scanf ("%hhS", ls); /* { dg-warning "length" "bad %hhS" } */
scanf ("%lS", ls); /* { dg-warning "length character" "bad %lS" } */ scanf ("%lS", ls); /* { dg-warning "length" "bad %lS" } */
scanf ("%llS", ls); /* { dg-warning "length character" "bad %llS" } */ scanf ("%llS", ls); /* { dg-warning "length" "bad %llS" } */
scanf ("%jS", ls); /* { dg-warning "length character" "bad %jS" } */ scanf ("%jS", ls); /* { dg-warning "length" "bad %jS" } */
scanf ("%zS", ls); /* { dg-warning "length character" "bad %zS" } */ scanf ("%zS", ls); /* { dg-warning "length" "bad %zS" } */
scanf ("%tS", ls); /* { dg-warning "length character" "bad %tS" } */ scanf ("%tS", ls); /* { dg-warning "length" "bad %tS" } */
scanf ("%LS", ls); /* { dg-warning "length character" "bad %LS" } */ scanf ("%LS", ls); /* { dg-warning "length" "bad %LS" } */
/* In C99 mode (even with extensions), %aS is a floating point /* In C99 mode (even with extensions), %aS is a floating point
format followed by an S. format followed by an S.
*/ */
......
...@@ -12,7 +12,7 @@ size_t ...@@ -12,7 +12,7 @@ size_t
foo (void) foo (void)
{ {
size_t t; size_t t;
scanf ("%zu", &t); /* { dg-bogus "length character|format" "bogus scanf warning" } */ scanf ("%zu", &t); /* { dg-bogus "length|format" "bogus scanf warning" } */
return t; return t;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment