diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.dg/format/ext-6.c | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.dg/format/ext-6.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/format/ext-6.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/format/ext-6.c b/gcc/testsuite/gcc.dg/format/ext-6.c new file mode 100644 index 000000000..08d24cbf7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ext-6.c @@ -0,0 +1,47 @@ +/* Test for format extensions. Test that the C99 functions get their + default attributes in gnu89 mode. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile } */ +/* { dg-options "-std=gnu89 -Wformat" } */ + +#include "format.h" + +void +foo (int i, char *s, size_t n, int *ip, va_list v0, va_list v1, va_list v2, + va_list v3, va_list v4, va_list v5, va_list v6, va_list v7, va_list v8, + va_list v9, va_list v10, va_list v11, va_list v12, va_list v13) +{ + fprintf (stdout, "%d", i); + fprintf (stdout, "%ld", i); /* { dg-warning "format" "fprintf" } */ + printf ("%d", i); + printf ("%ld", i); /* { dg-warning "format" "printf" } */ + fprintf_unlocked (stdout, "%d", i); + fprintf_unlocked (stdout, "%ld", i); /* { dg-warning "format" "fprintf_unlocked" } */ + printf_unlocked ("%d", i); + printf_unlocked ("%ld", i); /* { dg-warning "format" "printf_unlocked" } */ + sprintf (s, "%d", i); + sprintf (s, "%ld", i); /* { dg-warning "format" "sprintf" } */ + snprintf (s, n, "%d", i); + snprintf (s, n, "%ld", i); /* { dg-warning "format" "snprintf" } */ + vfprintf (stdout, "%d", v0); + vfprintf (stdout, "%Y", v1); /* { dg-warning "format" "vfprintf" } */ + vprintf ("%d", v2); + vprintf ("%Y", v3); /* { dg-warning "format" "vprintf" } */ + vsprintf (s, "%d", v4); + vsprintf (s, "%Y", v5); /* { dg-warning "format" "vsprintf" } */ + vsnprintf (s, n, "%d", v6); + vsnprintf (s, n, "%Y", v7); /* { dg-warning "format" "vsnprintf" } */ + fscanf (stdin, "%d", ip); + fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */ + scanf ("%d", ip); + scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */ + sscanf (s, "%d", ip); + sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */ + vfscanf (stdin, "%d", v8); + vfscanf (stdin, "%Y", v9); /* { dg-warning "format" "vfscanf" } */ + vscanf ("%d", v10); + vscanf ("%Y", v11); /* { dg-warning "format" "vscanf" } */ + vsscanf (s, "%d", v12); + vsscanf (s, "%Y", v13); /* { dg-warning "format" "vsscanf" } */ +} |