1 /* Test messages for -Wconversion, including that they are not
3 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
4 /* { dg-do compile } */
5 /* { dg-options "-std=c99 -pedantic-errors -Wconversion" } */
9 void fsll(signed long long);
10 void fuc(unsigned char);
11 void fui(unsigned int);
12 void full(unsigned long long);
14 void fld(long double);
15 void fcf(_Complex
float);
18 void (*fsc
)(signed char);
19 void (*fsi
)(signed int);
20 void (*fsll
)(signed long long);
21 void (*fuc
)(unsigned char);
22 void (*fui
)(unsigned int);
23 void (*full
)(unsigned long long);
25 void (*fld
)(long double);
26 void (*fcf
)(_Complex
float);
34 unsigned long long ull
;
42 fsi(f
); /* { dg-warning "warning: passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */
43 x
.fsi(f
); /* { dg-warning "warning: passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */
44 fsi(cf
); /* { dg-warning "warning: passing argument 1 of 'fsi' as integer rather than complex due to prototype" } */
45 x
.fsi(cf
); /* { dg-warning "warning: passing argument 1 of 'x.fsi' as integer rather than complex due to prototype" } */
46 fcf(f
); /* { dg-warning "warning: passing argument 1 of 'fcf' as complex rather than floating due to prototype" } */
47 x
.fcf(f
); /* { dg-warning "warning: passing argument 1 of 'x.fcf' as complex rather than floating due to prototype" } */
48 fcf(si
); /* { dg-warning "warning: passing argument 1 of 'fcf' as complex rather than integer due to prototype" } */
49 x
.fcf(si
); /* { dg-warning "warning: passing argument 1 of 'x.fcf' as complex rather than integer due to prototype" } */
50 ff(sc
); /* { dg-warning "warning: passing argument 1 of 'ff' as floating rather than integer due to prototype" } */
51 x
.ff(sc
); /* { dg-warning "warning: passing argument 1 of 'x.ff' as floating rather than integer due to prototype" } */
52 ff(cf
); /* { dg-warning "warning: passing argument 1 of 'ff' as floating rather than complex due to prototype" } */
53 x
.ff(cf
); /* { dg-warning "warning: passing argument 1 of 'x.ff' as floating rather than complex due to prototype" } */
54 ff(1.0); /* { dg-warning "warning: passing argument 1 of 'ff' as 'float' rather than 'double' due to prototype" } */
55 x
.ff(1.0); /* { dg-warning "warning: passing argument 1 of 'x.ff' as 'float' rather than 'double' due to prototype" } */
56 fsll(sc
); /* { dg-warning "warning: passing argument 1 of 'fsll' with different width due to prototype" } */
57 x
.fsll(sc
); /* { dg-warning "warning: passing argument 1 of 'x.fsll' with different width due to prototype" } */
58 fsc(sll
); /* { dg-warning "warning: passing argument 1 of 'fsc' with different width due to prototype" } */
59 x
.fsc(sll
); /* { dg-warning "warning: passing argument 1 of 'x.fsc' with different width due to prototype" } */
60 fsi(ui
); /* { dg-warning "warning: passing argument 1 of 'fsi' as signed due to prototype" } */
61 x
.fsi(ui
); /* { dg-warning "warning: passing argument 1 of 'x.fsi' as signed due to prototype" } */
62 full(sll
); /* { dg-warning "warning: passing argument 1 of 'full' as unsigned due to prototype" } */
63 x
.full(sll
); /* { dg-warning "warning: passing argument 1 of 'x.full' as unsigned due to prototype" } */