Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Oct 1998 21:11:19 -0700
From:      John Polstra <jdp@polstra.com>
To:        jkh@FreeBSD.ORG
Cc:        committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/lib/libutil libutil.h
Message-ID:  <199810090411.VAA27179@austin.polstra.com>
In-Reply-To: <199810082310.QAA08944@freefall.freebsd.org>
References:  <199810082310.QAA08944@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <199810082310.QAA08944@freefall.freebsd.org>,
Jordan K. Hubbard <jkh@FreeBSD.ORG> wrote:
> jkh         1998/10/08 16:10:42 PDT
> 
>   Modified files:
>     lib/libutil          libutil.h 
>   Log:
>   remove stdio.h include; I forgot Bruce's cardinal rule that header files
>   shouldn't include other ones

This broke make world:

===> libexec/getty
cc -O -pipe   -I/usr/obj/elf/usr/src/tmp/usr/include -c /usr/src/libexec/getty/main.c
In file included from /usr/src/libexec/getty/main.c:58:
/usr/obj/elf/usr/src/tmp/usr/include/libutil.h:60: parse error before `*'
*** Error code 1

This back-out seems counter-productive to me.  You get the namespace
pollution no matter what.  If you're using libutil.h then stdio.h
has to be included one way or another to avoid compilation errors.
It's better to make that automatic than to require the programmer to
remember it.  As it is now, the programmer has to remember the magic
FreeBSD-specific header file dependencies and ordering rules, but he
still gets exactly the same namespace pollution.

This has not eliminated any problem, but it has reduced portability
and made the programmer's job more difficult.

John
--
   John Polstra                                       jdp@polstra.com
   John D. Polstra & Co., Inc.                Seattle, Washington USA
   "Self-knowledge is always bad news."                 -- John Barth



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