X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs Date: Mon, 6 Mar 2000 15:35:30 +0100 (MET) From: Hans-Bernhard Broeker X-Sender: broeker AT acp3bf To: djgpp-workers AT delorie DOT com Subject: Re: iso646.h and some questions In-Reply-To: <200003060929.KAA16122@mars.lu.erisoft.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 6 Mar 2000, Martin Stromberg wrote: > > > No. The standard says NULL is defined in wchar.h and in stddef.h. > > > > Yes but it does not say, it should be a specific macro, it just mean > > that if one #include they can use NULL because it will be defined > > Most will just #include to pull the relevant macros. > > But for inttypes.h it explicitly says that inttypes.h #includes > stdint.h. So I get the impression that files shouldn't #include each > other unless it is stated. In the actual standard, it's even quite a bit stronger than that: none of the standard headers is *allowed* to just #include any of the others. They're supposed to be choosable 100% independantly. The new version may have some exceptions to this rule given explicitly, but the general rule from old ANSI/ISO C89 still holds unchanged, in C99 (according to the last draft I grabbed): Section 7.1.3, "Reserved identifiers" -- Each identifier with file scope listed in any of the following subclauses (including the future library directions) is reserved for use as macro and as an identifier with file scope in the same name space if any of its associated headers is included. [#2] No other identifiers are reserved. If the program These two together mean that unless a program #include's a particular header, none of the functions, types and macros it declares are allowed to be predefined by the library. They must remain free for the program's own use. If #include'd , e.g., the program would lose its ability to define a type 'size_t' or 'ptrdiff_t'. The reason for this is simple: without this mutual independence, the whole point of having standard header files would be moot: the C Preprocessor would just include all of them, by force, and no programmer would have to 'waste his time' typing #include . Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.