Article View: comp.lang.c.moderated
Article #2471Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.c++.moderated,comp.lang.c.moderated
From: USENET News System
Date: Wed, 03 Apr 1996 13:05
Date: Wed, 03 Apr 1996 13:05
33 lines
1446 bytes
1446 bytes
/* 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 */
}
typedef struct tagA { int a; int b; } *UA;
typedef struct tagB { float ttt; } *UB;
void
g( UA x, UB y )
{
g ( y, x); /* This does not */
/* error C2664: 'g' :
cannot convert parameter 1 from 'struct tagB*' to 'struct tagA*' */
}
/* My question is this: Why does the function f compile without errors?
I've tried this code in gcc and I get an error in both functions.
Who is right here? I suspect gcc is correct, but is Microsoft's
implemention allowable in the standard also? */
# Eldon Olmstead, Software Engineer
# PRIOR Data Sciences Ltd, Phone: (902) 423-1331, Ext 240
# 5475 Spring Garden Road, Suite 601,
# Halifax, Nova Scotia, B3J-3T2
# Canada
Technical Details
Message-ID:
<4jtt2c$3eq@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: USENET News System <news@spar.ca> Newsgroups: comp.lang.c.moderated Subject: Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.c++.moderated,comp.lang.c.moderated Date: 3 Apr 1996 07:05:16 -0600 Organization: PRIOR Data Sciences Ltd. Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4jtt2c$3eq@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Newsreader: News Xpress Version 1.0 Beta #3