Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/format/nonlit-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line source
/* Test for warnings for non-string-literal formats. */ /* Origin: Joseph Myers <jsm28@cam.ac.uk> */ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat -Wformat-nonliteral" } */ #include "format.h" void foo (char *s, size_t i) { printf ((const char *)i, i); /* { dg-warning "argument types" "non-literal" } */ printf (s, i); /* { dg-warning "argument types" "non-literal" } */ }