[11408] in Athena Bugs

home help back first fref pref prev next nref lref last post

decmips 7.6G: is not protected against multiple inclusion

daemon@ATHENA.MIT.EDU (Calvin Clark)
Mon Nov 22 03:52:08 1993

From: Calvin Clark <ckclark@MIT.EDU>
To: bugs@MIT.EDU
Date: Mon, 22 Nov 93 03:51:53 EST

System name:		hodge
Type and version:	KN01 7.6G (1 update(s) to same version)
Display type:		PMAX-MFB

What were you trying to do?

	Compile a program which included <sys/socket.h>
	more than once.

What's wrong:

	I got compiler errors because things like
	struct sockaddr were redeclared.

What should have happened:

	Most ULTRIX header files are protected against
	this by doing something like:

		#ifndef _SYS_SOCKET_H
		#define _SYS_SOCKET_H

		/* code here */

		#endif

	<sys/socket.h> should do this, too.

Please describe any relevant documentation references:

	The ANSI standard actually only requires idempotency
	for header files explicitly defined by the standard.
	However, it is considered bad manners to neglect
	such protection on any system header file.

home help back first fref pref prev next nref lref last post