Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Dec 1998 12:33:49 -0500 (EST)
From:      Alfred Perlstein <bright@hotjobs.com>
To:        rssh@grad.kiev.ua
Cc:        hackers@FreeBSD.ORG
Subject:   Re: inclusion of system headers.
Message-ID:  <Pine.BSF.4.05.9812091223220.27793-100000@bright.fx.genx.net>
In-Reply-To: <366ECBDA.BB19E1F2@Shevchenko.Kiev.UA>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/uio.h> and <sys/types.h>,
> > > which breaks clear compiling of erlang  (which yesteday was releasing
> > > as open source with NPL-style license).
> > >
> > > <begin quote from erlang mail list:>
> >
> > 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 <stdio.h> 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



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