From owner-freebsd-current Tue Jan 27 02:58:59 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA28229 for current-outgoing; Tue, 27 Jan 1998 02:58:59 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA28224 for ; Tue, 27 Jan 1998 02:58:57 -0800 (PST) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id DAA25275; Tue, 27 Jan 1998 03:01:07 -0800 (PST) Message-Id: <199801271101.DAA25275@implode.root.com> To: Terry Lambert cc: current@FreeBSD.ORG Subject: Re: PATCH: if_de.c #ifdef based version encoding In-reply-to: Your message of "Tue, 27 Jan 1998 10:08:45 GMT." <199801271008.DAA04483@usr09.primenet.com> From: David Greenman Reply-To: dg@root.com Date: Tue, 27 Jan 1998 03:01:07 -0800 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk >The value of the manifest constant __FreeBSD__ is derived from the >compiler tools and not from the kernel being built. > >In other words, the value of __FreeBSD__ comes from the version of the >OS the tools were built on, not from the OS that's running or the one >that is being targeted. > >This means that if I build a v3 kernel using a v2 system's tools, the >"#if __FreeBSD__ >= 3" and "#if defined(__FreeBSD__) && __FreeBSD__ >= 3" >will not test true, even though that is, in fact, what I am building. > > >Version information should not be encoded in #ifdef's; that is what >branch tags are for. If I can check this code out, implicitly, I am >building a 3+ system. The "#if" tests are bogus. > >This patch allows people to compile v3 kernels containing if_de.c on v2 >systems. > >Please commit it. In theory, the de driver is maintained by Matt Thomas and he supports multiple OS's and OS versions in the code. You'll notice that there are #ifdef's for NetBSD and BSD/OS in there as well. If we were going to do as you suggest, then it would only make sense if all of the OS #ifdef's were removed. This will only make it more difficult for Matt to support FreeBSD, so I think it's a bad idea. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project