🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2520

Re: Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.c++.moderated,comp.lang.c.moderated

#2520
From: Jos A. Horsmeier
Date: Sat, 06 Apr 1996 14:40
40 lines
1855 bytes
In article <4k1qi3$5ig@solutions.solon.com>, fred@genesis.demon.co.uk wrote:
|>In article <4jtt2c$3eq@solutions.solon.com>
|>           news@spar.ca "USENET News System" writes:

|>/* 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;

|Under ANSI C TA and TB have two distinct, incompatible types, they cannot
|be directly assigned.

I beg to differ; Have a look at the Standard:

6.1.2.6 Compatible type and composite type

'Moreover, two structure [ ... ] types declared in two 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 [ ... ]'.

6.5.4.1 Pointer declarators

'For two pointer types to be compatible, both shall be identically
qualified and both shall be pointers to compatible types.'

[ end of quotes ]

The only thing that (still) bothers me, is the phrase 'two separate
translation units' ... Compiler checks don't span translation units ...
Does anyone has any idea what this phrase implies and what is meant
by it?

kind regards,

Jos aka jos@and.nl

-- 
Atnwgqkrl gy zit vgksr, ug qshiqwtzoeqs!
Technical Details
Message-ID: <4k5vop$9ub@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4jtt2c$3eq@solutions.solon.com> <4k1qi3$5ig@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: jos@and.nl (Jos A. Horsmeier)
Newsgroups: comp.lang.c.moderated
Subject: Re: Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.c++.moderated,comp.lang.c.moderated
Date: 6 Apr 1996 08:40:25 -0600
Organization: AND Operations Research B.V.
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4k5vop$9ub@solutions.solon.com>
References: <4jtt2c$3eq@solutions.solon.com> <4k1qi3$5ig@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com
X-Newsreader: WinVN 0.99.5