// { dg-do compile } | |
// { dg-options "-Wreal-conversion" } | |
#include <stddef.h> | |
int func1(int a) { | |
double f = a; | |
return f; // { dg-warning "conversion to" } | |
} | |
double func3(); | |
void func2() { | |
double g = 3.14; | |
float f = 1.8f; | |
int t = g; // { dg-warning "conversion to" } | |
int p; | |
p = f; // { dg-warning "conversion to" } | |
func1(g); // { dg-warning "conversion to" } | |
char c = f; // { dg-warning "conversion to" } | |
c = p; | |
int q; | |
q = func3(); // { dg-warning "conversion to" } | |
} |