🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1492

Re: compatibility of types

#1492
From: diamond
Date: Wed, 11 Jul 1990 04:18
21 lines
1563 bytes
In article <1990Jul11.002522.24178@ccu.umanitoba.ca> rpjday@ccu.umanitoba.ca writes:

>  Can someone tell me if ANSI C considers a type of int[3] in
>a prototype compatible with a type of int[5] in the function
>definition?  And are these compatible with a type of int*?
>A reference to the draft would do nicely (this is a subtle
>way of saying that I would RTFM if I knew which section of
>TFM was what I wanted :-)

The answers are yes and yes, because the first two types are adjusted
to be exactly the third type.  Section 3.7.1 states this, and section
3.5.4.3 has a sentence that refers to section 3.7.1.

However, you might want to beware of a subtle difference regarding
some types that you did not ask about.  int(*)[3] and int(*)[5] also
point to integers, but they are not compatible with each other.
It's a bit too subtle for me to figure out if each is compatible
with int* or not.
-- 
Norman Diamond, Nihon DEC     diamond@tkou02.enet.dec.com
This is me speaking.  If you want to hear the company speak, you need DECtalk.
Technical Details
Message-ID: <1842@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!diamond
References: <1990Jul11.002522.24178@ccu.umanitoba.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!diamond
From: diamond@tkou02.enet.dec.com (diamond@tkovoa)
Newsgroups: comp.std.c
Subject: Re: compatibility of types
Message-ID: <1842@tkou02.enet.dec.com>
Date: 11 Jul 90 04:18:45 GMT
References: <1990Jul11.002522.24178@ccu.umanitoba.ca>
Reply-To: diamond@tkou02.enet.dec.com (diamond@tkovoa)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 21