ng_netflow and BGP
Bruce Evans
brde at optusnet.com.au
Thu Apr 2 08:35:41 UTC 2015
On Thu, 2 Apr 2015, William Waites wrote:
> On Thu, 02 Apr 2015 10:07:29 +0900, "Paul S." <contact at 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
More information about the freebsd-net
mailing list