Article View: comp.std.c
Article #3081Re: type compatibility
From: Norman Diamond
Date: Wed, 29 May 1991 02:25
Date: Wed, 29 May 1991 02:25
35 lines
1774 bytes
1774 bytes
In article <1991May15.205506.24139@athena.mit.edu> tada@athena.mit.edu (Michael J Zehr) writes:
>suppose you have file1.c:
> typedef Name char[10];
>and file2.c:
> typedef Name char[10];
>is this technically correct (i.e. ansi conforming)? it works correctly
>on my compiler, however my version of lint (lintplus from IPT for VMS)
>complains that something is supposed to take an array argument and it's
>getting a pointer argument.
You should get error messages for that typedef syntax.
However, C has no such thing as an array argument, and your version
of lint doesn't seem to be for the C language.
If you have file1.c:
typedef char Name[10];
> void something(Name x);
> void foo(void) {
> Name x;
> something(x);
> }
and file2.c:
typedef char Name[10];
> void something(Name x) {
> }
then it is impeccable ANSI C. something is supposed to take a pointer
argument, and gets one.
--
Norman Diamond diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Permission is granted to feel this signature, but not to look at it.
Technical Details
Message-ID:
<1991May29.022544.13579@tkou02.enet.dec.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit533!diamondReferences:
<1991May15.205506.24139@athena.mit.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!jit533!diamond From: diamond@jit533.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.std.c Subject: Re: type compatibility Message-ID: <1991May29.022544.13579@tkou02.enet.dec.com> Date: 29 May 91 02:25:44 GMT References: <1991May15.205506.24139@athena.mit.edu> Sender: usenet@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 35