1/* Test messages for -Wtraditional-conversion, including that they are not 2 pedwarns. */ 3/* Origin: Joseph Myers <jsm@polyomino.org.uk> */ 4/* { dg-do compile } */ 5/* { dg-options "-std=c99 -pedantic-errors -Wtraditional-conversion" } */ 6 7void fsc(signed char); 8void fsi(signed int); 9void fsll(signed long long); 10void fuc(unsigned char); 11void fui(unsigned int); 12void full(unsigned long long); 13void ff(float); 14void fld(long double); 15void fcf(_Complex float); 16 17struct s { 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); 24 void (*ff)(float); 25 void (*fld)(long double); 26 void (*fcf)(_Complex float); 27} x; 28 29signed char sc; 30signed int si; 31signed long long sll; 32unsigned char uc; 33unsigned int ui; 34unsigned long long ull; 35float f; 36long double ld; 37_Complex float cf; 38 39void 40g (void) 41{ 42 fsi(f); /* { dg-warning "passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */ 43 x.fsi(f); /* { dg-warning "passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */ 44 fsi(cf); /* { dg-warning "passing argument 1 of 'fsi' as integer rather than complex due to prototype" } */ 45 x.fsi(cf); /* { dg-warning "passing argument 1 of 'x.fsi' as integer rather than complex due to prototype" } */ 46 fcf(f); /* { dg-warning "passing argument 1 of 'fcf' as complex rather than floating due to prototype" } */ 47 x.fcf(f); /* { dg-warning "passing argument 1 of 'x.fcf' as complex rather than floating due to prototype" } */ 48 fcf(si); /* { dg-warning "passing argument 1 of 'fcf' as complex rather than integer due to prototype" } */ 49 x.fcf(si); /* { dg-warning "passing argument 1 of 'x.fcf' as complex rather than integer due to prototype" } */ 50 ff(sc); /* { dg-warning "passing argument 1 of 'ff' as floating rather than integer due to prototype" } */ 51 x.ff(sc); /* { dg-warning "passing argument 1 of 'x.ff' as floating rather than integer due to prototype" } */ 52 ff(cf); /* { dg-warning "passing argument 1 of 'ff' as floating rather than complex due to prototype" } */ 53 x.ff(cf); /* { dg-warning "passing argument 1 of 'x.ff' as floating rather than complex due to prototype" } */ 54 ff(1.0); /* { dg-warning "passing argument 1 of 'ff' as 'float' rather than 'double' due to prototype" } */ 55 x.ff(1.0); /* { dg-warning "passing argument 1 of 'x.ff' as 'float' rather than 'double' due to prototype" } */ 56 fsll(sc); /* { dg-warning "passing argument 1 of 'fsll' with different width due to prototype" } */ 57 x.fsll(sc); /* { dg-warning "passing argument 1 of 'x.fsll' with different width due to prototype" } */ 58 fsc(sll); /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" } */ 59 x.fsc(sll); /* { dg-warning "passing argument 1 of 'x.fsc' with different width due to prototype" } */ 60 fsi(ui); /* { dg-warning "passing argument 1 of 'fsi' as signed due to prototype" } */ 61 x.fsi(ui); /* { dg-warning "passing argument 1 of 'x.fsi' as signed due to prototype" } */ 62 full(sll); /* { dg-warning "passing argument 1 of 'full' as unsigned due to prototype" } */ 63 x.full(sll); /* { dg-warning "passing argument 1 of 'x.full' as unsigned due to prototype" } */ 64} 65