On Thu, 2 Apr 2015, William Waites wrote:
On Thu, 02 Apr 2015 10:07:29 +0900, "Paul S." <cont...@winterei.se> said:
> [pmacct's] use of 'return' (with no args) on functions that are
> meant to return an int flat out makes it unable to compile on
> FreeBSD.
Yes, I found that surprising that any modern C compiler would tolerate
that at all.
This is interestingly different in C90 and C99.
In C90, the behaviour for returning without a value in a non-void function
is only explicitly undefined if the return value is used.
In C99, it is a constraint error to return without a value.
So C90 compilers should warn about the return but not fail to compile
the file unless they can tell that the return value is used, while C99
compilers should warn about the return and fail to compile the file.
Bruce
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"