From owner-freebsd-hackers Wed Dec 9 09:30:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA05137 for freebsd-hackers-outgoing; Wed, 9 Dec 1998 09:30:07 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bright.fx.genx.net (bright.fx.genx.net [206.64.4.154]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA05116 for ; Wed, 9 Dec 1998 09:30:04 -0800 (PST) (envelope-from bright@hotjobs.com) Received: from localhost (bright@localhost) by bright.fx.genx.net (8.9.1/8.9.1) with ESMTP id MAA43170; Wed, 9 Dec 1998 12:33:49 -0500 (EST) (envelope-from bright@hotjobs.com) X-Authentication-Warning: bright.fx.genx.net: bright owned process doing -bs Date: Wed, 9 Dec 1998 12:33:49 -0500 (EST) From: Alfred Perlstein X-Sender: bright@bright.fx.genx.net To: rssh@grad.kiev.ua cc: hackers@FreeBSD.ORG Subject: Re: inclusion of system headers. In-Reply-To: <366ECBDA.BB19E1F2@Shevchenko.Kiev.UA> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 9 Dec 1998, Ruslan Shevchenko wrote: > > On Wed, 9 Dec 1998, Ruslan Shevchenko wrote: > > > > > > > > Question: > > > > > > Are exists some reasons, for existing next situation: > > > > > > A.h refer to something, including in B.h, but A.h not include B.h . > > > > > > I think, this is design bug. > > > > > > In FreeBSD such situation, at least with and , > > > which breaks clear compiling of erlang (which yesteday was releasing > > > as open source with NPL-style license). > > > > > > > > > > I thought the same too, however it was explained to me that several people > > spent a long time unwinding the headers. > > > > >From what i guess the problem of chaning the headers like linux does is: > > > > a) you may wish to redefine certain types for odd/masochistic reasons. > > ???? Read it again. > > b) it slows compile time signifigantly > > ??? > > #ifndef __A_H > #include A.h > #endif > > it is 3 strings of empty cpp output on one header inclusion. > Is it really slow compilation ? Where and when it was ? uh, no. Usually the #ifndef is inside the included file, which means opening the include files multiple times and parsing them just to abort. > > > > c) it's a solution for people who don't really know what goes where, > > and FreeBSD should encourage good programming practicies. > > > > Why FreeBSD is not writeln in assembler ? > > Mininmizing of dependences between different modules is one of axioms > of software engeneering. Seriosly. Seriously, chain everything off stdio.h, release your own version, call it 'AnnoyingBSD'. (or Lin** :) ) Or, you could make one big header file called "unix.h" > > > > Basically if you RTFM on functions and read most programming texts > > they will explain what to include and where. > > > > But why to do this work n times, during porting of each software > package, if this work can be complete eliminated once. See previous answer. > > > > Lastly, why not have #include just suck in the whole include/* ? > > doesn't sound too apetizing now does it? :) > > > > In general, you want, that "only correct writeln software" must > be easy ported to FreeBSD. And you minimize source code compability > between FreeBSD and other systems, when software is not writeln in > correct esoteric stream ;) > > More usefull, I think, is maximize source code compability, is better, > then create artiffical difficultes for porting. including the correct header files is hardly a portability issue. In fact, when following the FreeBSD include path code will most always compile correctly on Linux/Solaris/other unicies. I didn't make this design decision, Jordan told me about it and that a lot of work was done to get it this way. You can also garner information about a Program by looking at what header files it includes, this would totally defeat the purpose. You may find inconsistancies with what I'm saying, ie. some headers DO include other files, however if you look closely the nested includes are mostly there only to grab FreeBSD specific includes. lastly, what is "writeln" ? -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message