summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/format/nonlit-3.c
blob: ce94c8c36683f965acc59d0a82c65ababab35e1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* Test for warnings for non-string-literal formats.  Test for strftime 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 m, const struct tm *tp, char *fmt)
{
  strftime (s, m, fmt, tp); /* { dg-warning "format string" "non-literal" } */
}