Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!qantel!lll-lcc!lll-crg!rutgers!caip!cbmvax!daveh From: daveh@cbmvax.cbm.UUCP (Dave Haynie) Newsgroups: net.micro.amiga Subject: Re: Vt100 v2.1 warnings Message-ID: <793@cbmvax.cbmvax.cbm.UUCP> Date: Fri, 26-Sep-86 12:15:00 EDT Article-I.D.: cbmvax.793 Posted: Fri Sep 26 12:15:00 1986 Date-Received: Tue, 30-Sep-86 20:33:33 EDT References: <344@sivax.UUCP> Organization: Commodore Technology, West Chester, PA Lines: 50 > > Hello, > > I pulled down the VT100 V2.1 sources and compiled them with Lattice 'C' > v3.03 after setting VT100.h to LATTICE. > It worked ok, but had some questions about some warnings I recieved. > In the module Script.c, I recieved 2 warning: > > Line 427 and 490, Warning 85: Function return value mismatch > > I am just learning 'C', so it is all new to me. > > Phil Hunt > ..calma!sivax!phil Lattice incorporates some of the ANSI extensions, and you've just hit upon one of them, better type checking. Normal C compilers let you do many kinds of implicit convertions without telling you about it. Lattice still does the conversions, only it warns you about them. The most common instance of this I've seen is in functions that look something like: funct() { .... return; } Most C compilers won't say anything about this, but technically its wrong. When you specify "funct()" as above, it defaults to a function returning an integer. The return statement, however, isn't returning anything. Lattice would be happier with either of the following: funct() void funct() { { ... ... return 0; return; } } The first example explicitly returns a number, the second example explicitly defines a function that is supposed to have no result. Note that Lattice WILL produce working code in all three cases, only that in the first case it will generate a warning. -- ============================================================================ Dave Haynie {caip,ihnp4,allegra,seismo}!cbmvax!daveh These opinions are my own, though if you try them out, and decide that you really like them, a small donation would be appreciated.