[cc65] k&r c

Date view Thread view Subject view

From: Christian Groessler (cpg_at_aladdin.de)
Date: 2002-06-07 15:46:50


Hi,

I recently tried to compile a k&r c program with cc65 and found some
inconstistent behaviour.
Consider the following code

---------
bla(s)
     int s;
{
     if (s == 0)
         return;
}
---------

cc65 refuses to compile it, I get

t.c(7): Error: Function `bla' must return a value

If I replace the "return;" with "return 0;" it gets compiled.

So my question, why is this an error and not a warning only?
And, if it should be an error, why is it no error when I simply drop
out of the function without a return?

regards,
chris

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-06-07 15:47:50 CEST