From owner-svn-src-all@FreeBSD.ORG Mon Oct 15 15:11:49 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A13165D6; Mon, 15 Oct 2012 15:11:49 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 3920A8FC1A; Mon, 15 Oct 2012 15:11:49 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 0A445358C54; Mon, 15 Oct 2012 17:11:48 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id DFCFF2848C; Mon, 15 Oct 2012 17:11:47 +0200 (CEST) Date: Mon, 15 Oct 2012 17:11:47 +0200 From: Jilles Tjoelker To: Gleb Smirnoff Subject: Re: svn commit: r241546 - head/sys/contrib/ipfilter/netinet Message-ID: <20121015151147.GA92923@stack.nl> References: <201210141503.q9EF37rE087018@svn.freebsd.org> <201210150834.09553.jhb@freebsd.org> <20121015143658.GU89655@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121015143658.GU89655@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 15:11:49 -0000 On Mon, Oct 15, 2012 at 06:36:58PM +0400, Gleb Smirnoff wrote: > On Mon, Oct 15, 2012 at 08:34:09AM -0400, John Baldwin wrote: > J> On Sunday, October 14, 2012 11:03:07 am Gleb Smirnoff wrote: > J> > Author: glebius > J> > Date: Sun Oct 14 15:03:06 2012 > J> > New Revision: 241546 > J> > URL: http://svn.freebsd.org/changeset/base/241546 > J> > Log: > J> > Fix defines in r241245. We actually don't define FreeBSD. > J> > Reported & tested by: Oleg Ginzburg > J> Seems like it should be using 'defined(__FreeBSD_version)' instead? > AFAIU, the construction which left after r241546 works fine. Anything > undefined resolves to zero, so in case of non-FreeBSD build we test > if (0 > 10000019) and this fails which is what we expect. > I have used this construction several times already without any side > effects. I have also seen it in some software in ports, where it works > okay, too. The C standard indeed permits this, but gcc -Wundef will warn about it. That compiler warning is in CWARNFLAGS in sys/conf/kern.mk so I suggest adding the 'defined(__FreeBSD_version) &&'. -- Jilles Tjoelker