From owner-freebsd-net@FreeBSD.ORG Thu Apr 2 08:35:41 2015 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06459559 for ; Thu, 2 Apr 2015 08:35:41 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id BC464DE0 for ; Thu, 2 Apr 2015 08:35:40 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id D90233C5AE2; Thu, 2 Apr 2015 19:35:30 +1100 (AEDT) Date: Thu, 2 Apr 2015 19:35:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: William Waites Subject: Re: ng_netflow and BGP In-Reply-To: <20150402.090554.1118238546466593001.wwaites@tardis.ed.ac.uk> Message-ID: <20150402192937.F1001@besplex.bde.org> References: <20150401.115048.1362042954044146751.wwaites@tardis.ed.ac.uk> <551C9651.7050003@winterei.se> <20150402.090554.1118238546466593001.wwaites@tardis.ed.ac.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=A5NVYcmG c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=kCD_AYBHDVm8onu12G0A:9 a=CjuIK1q_8ugA:10 Cc: freebsd-net@freebsd.org, contact@winterei.se X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2015 08:35:41 -0000 On Thu, 2 Apr 2015, William Waites wrote: > On Thu, 02 Apr 2015 10:07:29 +0900, "Paul S." 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