Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!oliveb!jerry From: jerry@oliveb.UUCP (Jerry F Aguirre) Newsgroups: comp.sources.d Subject: Re: File access problem using ptc -- Message-ID: <4061@oliveb.UUCP> Date: Fri, 28-Aug-87 16:35:02 EDT Article-I.D.: oliveb.4061 Posted: Fri Aug 28 16:35:02 1987 Date-Received: Sun, 30-Aug-87 06:25:19 EDT References: <490@leah.Albany.Edu> Reply-To: jerry@oliveb.UUCP (Jerry F Aguirre) Organization: Olivetti ATC; Cupertino, Ca Lines: 43 Keywords: reset, pascal, ptc, um In article <490@leah.Albany.Edu> rds95@leah.Albany.Edu ( Robert Seals) writes: >"ptcbug.c", line 66: operands of : have incompatible types >"ptcbug.c", line 120: redeclaration of rewind >As far as the redefinition of rewind(), I am puzzled, because it puts >the definition at the very end of the new C program. Hmm. While there doesn't seem to be enough of the code to prove this I have a suggestion as to what might be wrong. I have seen this type of error before and it is usually something like this. main() { ... x = somefunc(...); ... } char * somefunc(...) { ... } The problem is that the first usage of somefunc causes its returned type to default to "int". The subsequent declaration of "char *" or whatever will cause the "redeclaration of" error message. Of course if the function is later defined as really returning "int" then there is no conflict. The sollution is to declare the type of all non-int functions before using them. You can either put all the sub-function definitions before they are used, (yucky bottom down pascal style,) or just declare the type as in: char *somefunc(); main() ... How this relates to the pascal version I don't know. Jerry Aguirre