Wednesday, 2 October 2013

C, error: control reaches end of non-void function [-Werror,-Wreturn-type]

C, error: control reaches end of non-void function [-Werror,-Wreturn-type]

struct quad {
int a;
int b;
int c;
}
int f(const int a, const int b, const int c, const int x){
const int l = a*x*x + b*x + c;
return l;
}
int safe_quad_eval(const struct quad q, const int x){
(f(q.a,q.b,q.c,x)>INT_MAX)||(f(q.a,q.b,q.c,x)<(-INT_MAX)) ? INT_MIN :
f(q.a,q.b,q.c,x);
}
I'm not sure what does this error mean? and how to solve it?

No comments:

Post a Comment