[sv-bc] 6.9.2 Equivalent types - question

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Mon Nov 21 2005 - 07:09:55 PST
Hi,

I have a question on Matching types vs. Equivalent types.

6.9.1(3) says,

"3) An anonymous enum, struct, or union type matches itself among data objects declared within the same declaration statement and no other data types.

struct packed {int A; int B;} AB1, AB2;// AB1, AB2 have matching types
struct packed {int A; int B;} AB3;     // the type of AB3 does not match the type of AB1"


6.9.2(2) says,

"2) An anonymous enum, unpacked struct, or unpacked union type is equivalent to itself among data objects declared within the same declaration statement and no other data types.

struct {int A; int B;} AB1, AB2; // AB1, AB2 have equivalent types
struct {int A; int B;} AB3;      // AB3 is not type equivalent to AB1"


If we look at the two texts, it seems that the case described by 6.9.2(2) is included in 6.9.1(3). 6.9.2(2) relates only to unpacked structs and unions (ignoring enums for now), whereas 6.9.1(3) makes no distinction between unpacked and packed structs and unions.

The example of 6.9.1(3) is of packed structs, but the text makes no such restriction.

Since matching is stronger than equivalence, this seems strange.

Comments?

Thanks,
Shalom

 
Shalom Bresticker
Intel Jerusalem LAD DA
+972 2 589-6852
+972 54 721-1033
I don't represent Intel 
Received on Mon Nov 21 07:10:04 2005

This archive was generated by hypermail 2.1.8 : Mon Nov 21 2005 - 07:11:02 PST