Article View: comp.sys.amiga.tech
Article #13891Re: Manx 5.0 problems
From: Daniel Elbaum
Date: Sat, 24 Feb 1990 00:56
Date: Sat, 24 Feb 1990 00:56
34 lines
1819 bytes
1819 bytes
In article <35312@grapevine.EBay.Sun.COM> golson@grapevine.EBay.Sun.COM (Greg Olson) writes:
:Hi everyone. I've been using Manx 5.0 for a little while, and thought I'd
:post a few problems I've run across.
[a few problems]
: 3) (Probably the most frustrating) It seems that Manx doesn't handle
: using new style prototyping and old style function definition parameter
: promotion correctly. For instance:
:
: int test_func(int); /* HAS TO BE INT FOR ANSI */
: main(){test_func('X');}
: int test_func(y)
: char y;
: { printf("X = %c\n",y); }
:
: will not print X to the screen (as it should, by my understanding of
: ANSI promotion rules for new-style prototype/old style function
: definitions).
:
:I have a few mail messages into Manx, but haven't heard word one as of yet.
:Can anyone verify/dispute these?
You give test_func an int, but it only takes a char. The prototype
for test_char() does not specify any conversion to int to be
performed at the point of the call. So an int gets passed, and part
of that int is what y refers to. There's never a guarantee that
mixing declaration styles as in this example will work the way you
expect. The danger is that sometimes it will.
--
Mine is red, round, and has three buttons. --B. Stroustrup
({uunet,tektronix,reed,sun!nosun,m2xenix}!oresoft!(dan)@oresoft.uu.net)
Technical Details
Message-ID:
<1990Feb24.005652.971@oresoft.uu.net>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!uakari!aplcen!uunet!oresoft!danReferences:
<35312@grapevine.EBay.Sun.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!uakari!aplcen!uunet!oresoft!dan From: dan@oresoft.uu.net (Daniel Elbaum) Newsgroups: comp.sys.amiga.tech Subject: Re: Manx 5.0 problems Message-ID: <1990Feb24.005652.971@oresoft.uu.net> Date: 24 Feb 90 00:56:52 GMT References: <35312@grapevine.EBay.Sun.COM> Reply-To: dan@oresoft.uu.net (Daniel Elbaum) Organization: Oregon Software, Portland, OR Lines: 34