Defect Report #139

Submission Date: 13 Jun 94
Submittor: Project Editor (P.J. Plauger)
Source: Larry Jones
Question
Subject: Compatibility of complete and incomplete types.
The Committee has already endorsed the concept of using incomplete types which are completed in some translation units and left incomplete in others for encapsulation and data hiding (cf. Defect Report #059). However, I can find nothing in the Standard which allows the incomplete type to be compatible with the completed type, which causes such usage to be not strictly conforming. I believe this to be an oversight.
Correction
In subclause 6.1.2.6, page 25, first paragraph, change:
Moreover, two structure, union, or enumerated types declared in separate translation units are compatible if they have the same number of members, the same member names, and compatible member types; for two structures, the members shall be in the same order; for two structures or unions, the bit-fields shall have the same widths; for two enumerated types, the members shall have the same values.
to:
Moreover, two structure, union, or enumerated types declared in separate translation units are compatible if at least one is an incomplete type or if they have the same number of members, the same member names, and compatible member types; for two complete structure types, the members shall be in the same order; for two complete structure or union types, the bit-fields shall have the same widths; for two enumerated types, the members shall have the same values.
Previous Defect Report < - > Next Defect Report