annotate gcc/testsuite/gcc.dg/format/ms_attr-4.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test for format attributes: test use of __attribute__
kono
parents:
diff changeset
2 in prefix attributes. */
kono
parents:
diff changeset
3 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
kono
parents:
diff changeset
4 /* { dg-do compile { target { *-*-mingw* } } } */
kono
parents:
diff changeset
5 /* { dg-options "-std=gnu99 -Wformat" } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 #define USE_SYSTEM_FORMATS
kono
parents:
diff changeset
8 #include "format.h"
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 extern __attribute__((format(ms_printf, 1, 2))) void tformatprintf0 (const char *, ...);
kono
parents:
diff changeset
11 extern void __attribute__((format(ms_printf, 1, 2))) tformatprintf1 (const char *, ...);
kono
parents:
diff changeset
12 extern void foo (void), __attribute__((format(ms_printf, 1, 2))) tformatprintf2 (const char *, ...);
kono
parents:
diff changeset
13 extern __attribute__((noreturn)) void bar (void), __attribute__((format(ms_printf, 1, 2))) tformatprintf3 (const char *, ...);
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 void
kono
parents:
diff changeset
16 baz (int i, int *ip, double d)
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 tformatprintf0 ("%d", i);
kono
parents:
diff changeset
19 tformatprintf0 ("%"); /* { dg-warning "format" "attribute format printf case 0" } */
kono
parents:
diff changeset
20 tformatprintf1 ("%d", i);
kono
parents:
diff changeset
21 tformatprintf1 ("%"); /* { dg-warning "format" "attribute format printf case 1" } */
kono
parents:
diff changeset
22 tformatprintf2 ("%d", i);
kono
parents:
diff changeset
23 tformatprintf2 ("%"); /* { dg-warning "format" "attribute format printf case 2" } */
kono
parents:
diff changeset
24 tformatprintf3 ("%d", i);
kono
parents:
diff changeset
25 tformatprintf3 ("%"); /* { dg-warning "format" "attribute format printf case 3" } */
kono
parents:
diff changeset
26 }