annotate gcc/testsuite/gcc.dg/Wtraditional-conversion-2.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test messages for -Wtraditional-conversion, including that they are not
kono
parents:
diff changeset
2 pedwarns. */
kono
parents:
diff changeset
3 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
kono
parents:
diff changeset
4 /* { dg-do compile } */
kono
parents:
diff changeset
5 /* { dg-options "-std=c99 -pedantic-errors -Wtraditional-conversion" } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 void fsc(signed char);
kono
parents:
diff changeset
8 void fsi(signed int);
kono
parents:
diff changeset
9 void fsll(signed long long);
kono
parents:
diff changeset
10 void fuc(unsigned char);
kono
parents:
diff changeset
11 void fui(unsigned int);
kono
parents:
diff changeset
12 void full(unsigned long long);
kono
parents:
diff changeset
13 void ff(float);
kono
parents:
diff changeset
14 void fld(long double);
kono
parents:
diff changeset
15 void fcf(_Complex float);
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 struct s {
kono
parents:
diff changeset
18 void (*fsc)(signed char);
kono
parents:
diff changeset
19 void (*fsi)(signed int);
kono
parents:
diff changeset
20 void (*fsll)(signed long long);
kono
parents:
diff changeset
21 void (*fuc)(unsigned char);
kono
parents:
diff changeset
22 void (*fui)(unsigned int);
kono
parents:
diff changeset
23 void (*full)(unsigned long long);
kono
parents:
diff changeset
24 void (*ff)(float);
kono
parents:
diff changeset
25 void (*fld)(long double);
kono
parents:
diff changeset
26 void (*fcf)(_Complex float);
kono
parents:
diff changeset
27 } x;
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 signed char sc;
kono
parents:
diff changeset
30 signed int si;
kono
parents:
diff changeset
31 signed long long sll;
kono
parents:
diff changeset
32 unsigned char uc;
kono
parents:
diff changeset
33 unsigned int ui;
kono
parents:
diff changeset
34 unsigned long long ull;
kono
parents:
diff changeset
35 float f;
kono
parents:
diff changeset
36 long double ld;
kono
parents:
diff changeset
37 _Complex float cf;
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 void
kono
parents:
diff changeset
40 g (void)
kono
parents:
diff changeset
41 {
kono
parents:
diff changeset
42 fsi(f); /* { dg-warning "passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */
kono
parents:
diff changeset
43 x.fsi(f); /* { dg-warning "passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */
kono
parents:
diff changeset
44 fsi(cf); /* { dg-warning "passing argument 1 of 'fsi' as integer rather than complex due to prototype" } */
kono
parents:
diff changeset
45 x.fsi(cf); /* { dg-warning "passing argument 1 of 'x.fsi' as integer rather than complex due to prototype" } */
kono
parents:
diff changeset
46 fcf(f); /* { dg-warning "passing argument 1 of 'fcf' as complex rather than floating due to prototype" } */
kono
parents:
diff changeset
47 x.fcf(f); /* { dg-warning "passing argument 1 of 'x.fcf' as complex rather than floating due to prototype" } */
kono
parents:
diff changeset
48 fcf(si); /* { dg-warning "passing argument 1 of 'fcf' as complex rather than integer due to prototype" } */
kono
parents:
diff changeset
49 x.fcf(si); /* { dg-warning "passing argument 1 of 'x.fcf' as complex rather than integer due to prototype" } */
kono
parents:
diff changeset
50 ff(sc); /* { dg-warning "passing argument 1 of 'ff' as floating rather than integer due to prototype" } */
kono
parents:
diff changeset
51 x.ff(sc); /* { dg-warning "passing argument 1 of 'x.ff' as floating rather than integer due to prototype" } */
kono
parents:
diff changeset
52 ff(cf); /* { dg-warning "passing argument 1 of 'ff' as floating rather than complex due to prototype" } */
kono
parents:
diff changeset
53 x.ff(cf); /* { dg-warning "passing argument 1 of 'x.ff' as floating rather than complex due to prototype" } */
kono
parents:
diff changeset
54 ff(1.0); /* { dg-warning "passing argument 1 of 'ff' as 'float' rather than 'double' due to prototype" } */
kono
parents:
diff changeset
55 x.ff(1.0); /* { dg-warning "passing argument 1 of 'x.ff' as 'float' rather than 'double' due to prototype" } */
kono
parents:
diff changeset
56 fsll(sc); /* { dg-warning "passing argument 1 of 'fsll' with different width due to prototype" } */
kono
parents:
diff changeset
57 x.fsll(sc); /* { dg-warning "passing argument 1 of 'x.fsll' with different width due to prototype" } */
kono
parents:
diff changeset
58 fsc(sll); /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" } */
kono
parents:
diff changeset
59 x.fsc(sll); /* { dg-warning "passing argument 1 of 'x.fsc' with different width due to prototype" } */
kono
parents:
diff changeset
60 fsi(ui); /* { dg-warning "passing argument 1 of 'fsi' as signed due to prototype" } */
kono
parents:
diff changeset
61 x.fsi(ui); /* { dg-warning "passing argument 1 of 'x.fsi' as signed due to prototype" } */
kono
parents:
diff changeset
62 full(sll); /* { dg-warning "passing argument 1 of 'full' as unsigned due to prototype" } */
kono
parents:
diff changeset
63 x.full(sll); /* { dg-warning "passing argument 1 of 'x.full' as unsigned due to prototype" } */
kono
parents:
diff changeset
64 }