Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jul 1998 09:36:05 +0100 
From:      Paul Richards <paul@originative.co.uk>
To:        "'Jordan K. Hubbard'" <jkh@time.cdrom.com>, Bruce Evans <bde@zeta.org.au>
Cc:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-sys@FreeBSD.ORG
Subject:   RE: cvs commit: src/sys/pci if_tl.c if_tlreg.h 
Message-ID:  <E40CBF0361C7D111914000C0F0303D10864E@OCTOPUS>

next in thread | raw e-mail | index | archive | help
I'm a little behind on my mail (though rapidly catching up) so sorry to
bring this up again but I think it is worth distinguishing between two
different uses of #ifdef in FreeBSD.

I agree that it would be ridiculous to force third party vendors to
strip their code of FreeBSD #ifdef's when they import their code but I
think it's a really bad idea to use #ifdef to make code in the FreeBSD
tree compile on different versions of FreeBSD. That should definately be
ripped out and separate, cleaner versions of the code should be
maintained in each active branch.

There's no reason for version of a file in stable to have #ifdefs to
make it compile on current or vice versa, it just makes the code more
clumsy to read and not really any more maintainable since the
differences between the versions can often be significant and the #ifdef
spaghetti is very obfuscating in those situations.

Paul Richards Ph.D.
Originative Solutions Ltd


> -----Original Message-----
> From: Jordan K. Hubbard [mailto:jkh@time.cdrom.com]
> Sent: Friday, May 22, 1998 7:37 PM
> To: Bruce Evans
> Cc: cvs-all@FreeBSD.org; cvs-committers@FreeBSD.org; 
> cvs-sys@FreeBSD.org
> Subject: Re: cvs commit: src/sys/pci if_tl.c if_tlreg.h 
> 
> 
> > >Hmmm.  Just to be sure I understand your position - are you saying
> > >that sources should never use conditional compilation which depends
> > >on the FreeBSD version number?  That seems...  Draconian.
> > 
> > Yes.
> 
> Well, I guess someone has to stand up for moral purity and
> rightousness and I can even sort of picture you in red tights with a
> tattered cape, a pair of green underwear worn on the outside and a
> large "B" on your chest.
> 
> Hmmmm.  OK, I'm working really hard to get that picture out of my mind
> now and I'm sorry I ever mentioned it.
> 
> Needless to say, I think an attitude like this is somewhat impractical
> for the real world.  There's code which has to run on multiple *BSD
> variants and there's code which has variant #ifdefs in it made
> necessary by the fact that somebody, and I'm not mentioning any names,
> made like a weasel on amphetamines with the includes for 3.0 and
> rendered the idea of code which trivially compiles on both of our own
> branches somewhat problematic.
> 
> As long as code is written by humans and not Hal, and we've got these
> hyperactive weasels racing around making changes for changes sake,
> these sorts of #ifdefs are going to be an unfortunate and unavoidable
> fact of life.
> 
> - Jordan
> 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E40CBF0361C7D111914000C0F0303D10864E>