summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/format/ms_nonlit-3.c
blob: e8c8933bc7cfef0daaf746e1e5b2111ce4982255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Test for warnings for non-string-literal formats.  Test for strftime formats.  */
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* { dg-do compile { target { *-*-mingw* } } } */
/* { dg-options "-std=gnu99 -Wformat -Wformat-nonliteral" } */

#define USE_SYSTEM_FORMATS
#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" } */
}