Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 (USS@Tek, v1.0) based on 4.3bsd-beta 6/6/85; site tekigm2.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!pyramid!hplabs!tektronix!tekigm2!normc From: normc@tekigm2.UUCP (Norm Church) Newsgroups: net.micro.amiga Subject: Problem with Lattice C Compiler Message-ID: <471@tekigm2.UUCP> Date: Tue, 25-Feb-86 13:32:05 EST Article-I.D.: tekigm2.471 Posted: Tue Feb 25 13:32:05 1986 Date-Received: Fri, 28-Feb-86 21:29:49 EST Reply-To: normc@tekigm2.UUCP (Norm Church) Organization: Tektronix, Inc., Beaverton, OR. Lines: 59 I am having problems with the Lattice C compiler accepting the program that is listed below. It compiles and executes on a Vax unix system 4.2 but gives the following errors on my Amiga. This same problem occurs in version 3.03 and 3.02 of the compiler. Can someone see any reason why it should not compile on my Amiga? I would appreciate any help on this problem. Regards, Norm Church --------------------------------------------------- Errors listed in both versions 3.02 & 3.03: Lattice AMIGA 68000 C Compiler (Phase 1) V3.02 Copyright (C) 1984 Lattice, Inc.) ram:strncpy.c 32 Error 17: too many operands ram:strncpy.c 32 Error 57: semi-colon expected --------------------------------------------------- /* strncpy sample program */ #include main() { char fld[100]; char ans[100]; int len; strcpy(fld, "The first line to copy"); printf("copy 5 characters\n"); len=5; strncpy(ans, fld, len); printf("ans= %s\n", ans); printf("copy 10 characters\n"); len=10; strncpy(ans, fld, len); printf("ans= %s\n", ans); } /* ================================== */ strncpy(to, from, len) char *to; char *from; int len; { int n; for(n=1; n<=len; n++) <--- this is line 32 *to++ = *from++; that gets tagged *to='\0'; /* terminate string */ as an error. } /* strncpy() */ -------------------------------------------------------------