Funny bugs in some C compilers

Dave Decot decot at cwruecmp.UUCP
Wed Sep 14 17:23:21 AEST 1983


Seems to me that another solution to the "holes" problem of structure
comparison is somewhat clear:

	Permit comparison of two structures of the same tag or typedef
	for [in]equality only.  If the structure template involved contains
	no holes, compare the structures using a block-compare instruction
	(if available).  If there ARE holes, the result is the && conjunction
	[|| disjunction] of comparisons for [in]equality of constituent blocks
	that have no holes.
	
Thus, those areas of the structures that should be equal are compared,
and those that are "holes" are ignored, and the code thus generated can
be no worse than that generated by the poor programmer who has to
code this comparison by "hand".

No?  Replies are encouraged.

					Dave Decot
					..!decvax!cwruecmp!decot



More information about the Comp.lang.c mailing list