RE: [sv-bc] 6.9.2 Equivalent types - question

From: francoise martinolle <fm_at_.....>
Date: Mon Nov 21 2005 - 07:45:01 PST
 Shalom,

It is true that matching is stronger than equivalence.
All packed types are equivalent to each other this is the reason why they do
not appear in section 6.9.2 (2). The ex only illustrates unpacked structs.

The rule for matching types is the same for anonymous unpacked or packed
structs or enums.
The ex only illustrates packed anonymous structs in 6.9.1 (3)

Francoise
    '

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Bresticker, Shalom
Sent: Monday, November 21, 2005 10:10 AM
To: sv-bc@eda.org
Subject: [sv-bc] 6.9.2 Equivalent types - question

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:45:23 2005

This archive was generated by hypermail 2.1.8 : Mon Nov 21 2005 - 07:45:49 PST