aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c90-printf-1.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>2000-12-07 07:40:45 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2000-12-07 07:40:45 +0000
commit014e7f1d30678868964dcfbeaef278736ff932f5 (patch)
treeb240467cf5021de53c1a5fc93a3f6ef62f2878e3 /gcc/testsuite/gcc.dg/c90-printf-1.c
parent8308e0b7867616fda51ec1bd82833702880e85f4 (diff)
downloadgcc-014e7f1d30678868964dcfbeaef278736ff932f5.zip
gcc-014e7f1d30678868964dcfbeaef278736ff932f5.tar.gz
gcc-014e7f1d30678868964dcfbeaef278736ff932f5.tar.bz2
c-common.c (format_wanted_type): Add reading_from_flag.
* c-common.c (format_wanted_type): Add reading_from_flag. (print_char_table): Mark %s and %S formats with flag "R". (check_format_info_main): Set up reading_from_flag appropriately. If aflag, always set writing_in_flag rather than relying on the format used being a scanf format and so having it set. (check_format_types): Check for formats reading through null pointers. testsuite: * gcc.dg/c90-printf-1.c: Add test for printf formats reading through a null pointer. From-SVN: r38104
Diffstat (limited to 'gcc/testsuite/gcc.dg/c90-printf-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/c90-printf-1.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c90-printf-1.c b/gcc/testsuite/gcc.dg/c90-printf-1.c
index 85193ec..5058066 100644
--- a/gcc/testsuite/gcc.dg/c90-printf-1.c
+++ b/gcc/testsuite/gcc.dg/c90-printf-1.c
@@ -245,4 +245,5 @@ foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
printf ("%n", cn); /* { dg-warning "constant" "%n with const" } */
printf ((const char *)L"foo"); /* { dg-warning "wide" "wide string" } */
printf ("%n", (int *)0); /* { dg-warning "null" "%n with NULL" } */
+ printf ("%s", (char *)0); /* { dg-warning "null" "%s with NULL" } */
}