system.h

John Carr jfc@mit.edu
Mon Feb 16 05:16:00 GMT 1998


> 	With respect to the amount system.h includes, I don't agree
> with your view that it includes too much.  You don't state what you
> perceive as the disadvantage to including various files, other than to
> say they are not ANSI, but I will assume you mean it affects
> compilation time.

In my experience #including everything leads to trouble.

The ANSI C files are mostly harmless, but more importantly they are
necessary.  The others are neither harmless nor necessary in most
cases.

Here is an example: on x86 SVR4 systems <sys/stat.h> defines several
static functions.

I don't see a maintenance problem in adding one or a few macro tests
to system.h surrounding the rarely needed include files.

[re #define bcopy memcpy]
> 	This is somewhat murky since I believe the coding standard is
> to still require the old BSD style stuff should be used.

I'm not proposing changing the source yet.  In the source files bcopy
and friends would still be used until gcc is converted to ANSI C.
Most modern compilers (including gcc) know about the builtin ANSI
functions and should be given the chance to use their knowledge.




More information about the Gcc mailing list