Funny bugs in some C compilers

Guy Harris guy at rlgvax.UUCP
Fri Sep 2 08:21:09 AEST 1983


According to "Recent Changes to C", distributed both with V7 and System III
UNIX:

	"Structures may be assigned, passed as arguments to functions, and
	returned by functions. ... Other plausible operators, such as
	equality comparison, have not been implemented."

>From a document distributed in machine-readable form only(!) with System III:

	Structure assignment has been added to the C language
	to simplify both the source and object code associated
	with transferring the value of one structure instance to
	another and to allow functions to return aggregate
	values when invoked.
	Since many processors now contain some type
	of `move block' instruction, structure assignment
	will permit more efficient use of many machines.
	It also makes source programs more readable.

	Structures may be assigned, passed as arguments to functions,
	and returned by functions.
	The types of structure operands taking part must be the same.
	Other plausible operators, such as equality comparison
	and structure casts,
	are not being implemented due
	to the difficulties associated with "holes"
	in structures caused by alignment restrictions.

So the problem with structure comparison is known; in fact, that's why none
of the C compilers I've encountered implement it.

	Guy Harris
	{seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy



More information about the Comp.lang.c mailing list