Re: Compile error with 3.0.11 snmp.c on SGI IRIX 6.5
| From: | Sascha Schumann | Date: | Sun, 11 Jul 1999 15:29:51 +0000 |
| Subject: | Re: Compile error with 3.0.11 snmp.c on SGI IRIX 6.5 | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-8361@lists.php.net to get a copy of this message | ||
> Yup, and the compiler accepted those. It complained about the lowercase
> "return" statements, however, which technically are invalid when inside of a
> void function. The latest version in the CVS tree had it fixed already, and
> this was already reported in bug #1636. So it's already fixed, though the
> 3.0.11 distribution still has the snmp.c with the compile bugs in it :-(. I
> guess the fixed one can be put into 3.0.12 ;-).
Ah, ok, that was it what confused me. I looked only at the
current cvs version and didn't notice anything irregular.
Btw, following K&R (don't know about ANSI/ISO C), returning a
non-void value in a void function should work.
9.10. Return statement
[...]
return expression;
[...] If required, the expression is converted, as if by
assignment, to the type of function in which it appears.
So, non-void should be simply casted to void. Stupid compiler.
--
Regards,
Sascha Schumann
Consultant