Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcnc!gatech!hubcap!turnera From: turnera@hubcap.UUCP (Allen Turner) Newsgroups: comp.lang.c Subject: Re: Borland's new C compiler Message-ID: <187@hubcap.UUCP> Date: Tue, 9-Jun-87 17:29:00 EDT Article-I.D.: hubcap.187 Posted: Tue Jun 9 17:29:00 1987 Date-Received: Fri, 12-Jun-87 04:43:43 EDT References: <2835@zen.berkeley.edu> <3400003@hpsrlc.HP.COM> Organization: Clemson University, Clemson, SC Lines: 57 Summary: feature or Bug with Turbo_C I encountered two problems during the process of converting a program from MSC 3.0 to Turbo_C and I don't know if they are bugs or features. The first problem (please don't flame me for this one, I inherited this code) occurred because Turbo_C, unlike MSC 3.0, requires the argument types of functions to be declared. MSC requires a function declaration if the function returns something other than an int while Turbo_C requires this and the declaration for all arguments. For example in MSC char *strswap(); /* in calling routine */ char *strswap(a,b,count); /* start of subroutine strswap */ char *a,*b; int count; { ... } would be required while in Turbo_C char *strswap(char *a,char *b,int count); /* in calling routine */ char *strswap(char *a, char *b,int count); /* start of subroutine strswap */ { .... } would be required. I haven't decided if this requirement is an indication of a smart compiler or a dumb one but the explicit declarations did allow Turbo_C to turn up some errors that MSC missed. The second problem I encountered involved the way MSC and Turbo_C deal with command lines. If the following command were given at the DOS prompt: C>test b="this is a test" MSC considers argv[1]='b="this is a test"' and argv[2]='' while Turbo_C considers argv[1]='b=' and argv[2]='this is a test' (Note: Turbo_C did eliminate the quotation marks as I have indicated). Which, if either of these, is correct? Are these bugs or features? I looked in K&R but I couldn't find a thorough explanation of either of these points. Allen Turner