Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!ll-xn!ames!pacbell!att!mtunx!chinet!mcdchg!clyde!watmath!watdcsu!ttims
From: ttims@watdcsu.waterloo.edu (Tracy Tims)
Newsgroups: comp.sys.ibm.pc
Subject: Re: WATCOM C 6.0 - soliciting opinions, posting a few of my own
Keywords: C, MS C, QuickC
Message-ID: <4837@watdcsu.waterloo.edu>
Date: 25 Jun 88 19:28:54 GMT
References: <1988Jun13.235444.22510@gpu.utcs.toronto.edu> <5935@pyr.gatech.EDU>
Reply-To: ttims@watdcsu.waterloo.edu (Tracy Tims)
Organization: U. of Waterloo, Ontario
Lines: 22

In article <5935@pyr.gatech.EDU> roy@pyr.gatech.EDU (Roy Mongiovi) writes:
>A major gripe for me is that you absolutely HAVE to convert your program
>to ANSI-C (at least to some extent).  If you use the old-style C function
>declarations (if you have no function prototypes), WATCOM passes arguments
>on the stack (the standard way), but if you DO have function prototypes
>it passes arguments in registers.

   This is not actually true.  Watcom C will pass arguments in registers
whether the function definitions are ANSI style or not.  It passes arguments on
the stack if it comes across an ANSI style varargs function.  This means that
all varargs functions must be declared using the ANSI style, or a pragma must
be used to tell the compiler that a specific function should have arguments
passed on the stack.  Varargs functions break if one of these two things is
not done.  In general, you can make code compile correctly by adding pragmas
that change any inappropriate calling conventions.  The pragmas do not have to
be added to the source files themselves, because there is a compiler option to
force a file inclusion that isn't given as a #include in the program source.

   I played around with a copy of Watcom C on an IBM PC, and other than that,
I have no connection with Watcom (even though I come from Waterloo!).

Tracy Tims