compile errors with /usr/include/sys/types.h

David G. Burton daveb at
Thu Mar 8 02:43:11 AEST 1990

In article <1990Mar1.022620.23226 at ice9.uucp> bgh at ice9.uucp (barry hannigan) writes:
| [<sys/types.h> lines that cause syntax errors]

In article <6730 at turnkey.TCC.COM> jackv at turnkey.TCC.COM replies:
|Barry,	there is nothing wrong with types.h, what is actually happening is
|that it is being included twice and the second pass through this stuff by
|the preprocessor causes the syntax error. You need to search through the
|include files, find the second inclusion and remove it. I have found the
|X source to be notorious for this problem. 

I have ``frequently'' run into this problem with <sys/types.h> when porting
software to my machine. Rather than modifying the various sources to
remove redundant #include's, I simply modify <sys/types.h> as in:

$ cat /usr/include/sys/types.h
#ifndef	SYS_TYPES_H
#define	SYS_TYPES_H
[ all of header file ]
#endif	/* SYS_TYPES_H */

Once this modification is made, no further problems due to multiple inclusion
of <sys/types.h> will occur.

Disclaimer: I don't speak for ISC; they don't speak for me.
Dave Burton

More information about the Comp.unix.i386 mailing list