summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-strings-c90.c
blob: 74e5fb17ccf7975b96e6ede5481691f88f9d7ab1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* RUN: %clang_cc1 -fsyntax-only -verify -pedantic -std=c89 %s
 */

int scanf(const char * restrict, ...);
int printf(const char *restrict, ...);

void foo(char **sp, float *fp, int *ip) {
  /* TODO: Warn that the 'a' length modifier is an extension. */
  scanf("%as", sp);
  scanf("%a[abc]", sp);

  /* TODO: Warn that the 'a' conversion specifier is a C99 feature. */
  scanf("%a", fp);
  scanf("%afoobar", fp);
  printf("%a", 1.0);
  printf("%as", 1.0);
  printf("%aS", 1.0);
  printf("%a[", 1.0);
  printf("%afoo", 1.0);

  scanf("%da", ip);
}
OpenPOWER on IntegriCloud