home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!psinntp!dg-rtp!snail!welshm
- From: welshm@snail.rtp.dg.com (Matt Welsh)
- Subject: Re: Error in MS C 6.0 ?
- Message-ID: <1992Jul22.204254.4707@dg-rtp.dg.com>
- Sender: usenet@dg-rtp.dg.com (Usenet Administration)
- Date: Wed, 22 Jul 92 20:42:54 GMT
- Distribution: comp
- References: <1992Jul21.175215.13891@vax5.cit.cornell.edu>
- Organization: Data General Corporation, RTP, NC.
- Lines: 46
-
- In article <1992Jul21.175215.13891@vax5.cit.cornell.edu> rdw@vax5.cit.cornell.edu writes:
- >Dear Microsoft 6.0 C programmers:
- >
- > Has anybody noticed a possible error in the Microsoft C 6.0 compiler in
- >the way it handles function prototyping? When passing single-precision float
- >arguments to a function, I get compilation errors when I try to use the
- >following together:
- >prototyping in the function allusion but 'old-style' argument declarations when
- >defining the function.
- >
- >For example:
- >
- >extern int func( int a, float x, int b);
- >
- >with
- >The prototyping works fine when I declare the arguments with the new method:
- >int func( a, x, b )
- > int a, b;
- > float x;
- >{
- >
- >
- >
- >int func( int a, float x, int b )
- >{
- >
- >If I use the old method, the compiler gives me a Parameter 2 mismatch error.
- >Does anybody know what's going on?
-
- Of course. If you use a prototype, MSC will expect new-style function def's.
- You get a Parameter 2 mismatch because MSC thinks that "x" is an integer.
-
-
- >
- > Baffled,
-
- Aren't we all every now and then.
-
- >
- > Aaron S. Chou
- > Cornell University
-
-
- Matt Welsh welshm@dg-rtp.dg.com ...!mcnc!rti!dg-rtp!welshm
- UNIX-SQA, Data General Corporation RTP Office: +1 919 248 6070
- "Do not taunt Happy Fun Ball."
-