home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11526 < prev    next >
Encoding:
Text File  |  1992-07-23  |  1.6 KB  |  59 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!psinntp!dg-rtp!snail!welshm
  3. From: welshm@snail.rtp.dg.com (Matt Welsh)
  4. Subject: Re: Error in MS C 6.0 ?
  5. Message-ID: <1992Jul22.204254.4707@dg-rtp.dg.com>
  6. Sender: usenet@dg-rtp.dg.com (Usenet Administration)
  7. Date: Wed, 22 Jul 92 20:42:54 GMT
  8. Distribution: comp
  9. References: <1992Jul21.175215.13891@vax5.cit.cornell.edu>
  10. Organization: Data General Corporation, RTP, NC.
  11. Lines: 46
  12.  
  13. In article <1992Jul21.175215.13891@vax5.cit.cornell.edu> rdw@vax5.cit.cornell.edu writes:
  14. >Dear Microsoft 6.0 C programmers:
  15. >
  16. >     Has anybody noticed a possible error in the Microsoft C 6.0 compiler in
  17. >the way it handles function prototyping?  When passing single-precision float
  18. >arguments to a function, I get compilation errors when I try to use the
  19. >following together:   
  20. >prototyping in the function allusion but 'old-style' argument declarations when
  21. >defining the function.
  22. >
  23. >For example:
  24. >
  25. >extern int func( int a, float x, int b);
  26. >
  27. >with
  28. >The prototyping works fine when I declare the arguments with the new method:
  29. >int func( a, x, b )
  30. >     int a, b;
  31. >     float x;
  32. >{
  33. >
  34. >
  35. >
  36. >int func( int a, float x, int b )
  37. >{
  38. >
  39. >If I use the old method, the compiler gives me a Parameter 2 mismatch error.
  40. >Does anybody know what's going on?
  41.  
  42. Of course. If you use a prototype, MSC will expect new-style function def's.
  43. You get a Parameter 2 mismatch because MSC thinks that "x" is an integer.
  44.  
  45.  
  46. >
  47. >        Baffled,
  48.  
  49. Aren't we all every now and then. 
  50.  
  51. >
  52. >        Aaron S. Chou
  53. >        Cornell University
  54.  
  55.  
  56. Matt Welsh    welshm@dg-rtp.dg.com        ...!mcnc!rti!dg-rtp!welshm
  57. UNIX-SQA, Data General Corporation RTP        Office: +1 919 248 6070
  58.   "Do not taunt Happy Fun Ball."
  59.