Article View: comp.lang.c.moderated
Article #2514Re: Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.c++.moderated,comp.lang.c.moderated
From: rdwells
Date: Fri, 05 Apr 1996 00:38
Date: Fri, 05 Apr 1996 00:38
28 lines
1426 bytes
1426 bytes
USENET News System wrote:
>
> /* Under the Microsoft Visual C++ 2.0 and 4.0 the following
> was observed. */
>
> typedef struct { int a; int b; } *TA;
> typedef struct { int a; int b; } *TB;
>
> void
> f( TA x, TB y )
> {
> f ( y, x); /* This compiles fine */
> }
I think VC++ has this right. Section 6.1.2.6 of the standard says:
Moreover, two structure, union, or enumeration 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...
Of course, this mentions "separate translation units", which
doesn't apply in this case, so perhaps my reading is incorrect.
I'm assuming here that you're treating this as a C source file,
and not a C++ file. I'll let someone else determine whether
this is valid C++ or not.
Technical Details
Message-ID:
<4k1q2a$59u@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4jtt2c$3eq@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: rdwells@mmm.com Newsgroups: comp.lang.c.moderated Subject: Re: Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.c++.moderated,comp.lang.c.moderated Date: 4 Apr 1996 18:38:34 -0600 Organization: 3M Company Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4k1q2a$59u@solutions.solon.com> References: <4jtt2c$3eq@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Mailer: Mozilla 2.0 (WinNT; I)