Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!orchid!rbutterworth From: rbutterworth@orchid.UUCP Newsgroups: comp.lang.c Subject: Re: impossible problem for find(1)? Message-ID: <7328@orchid.UUCP> Date: Tue, 5-May-87 11:04:24 EDT Article-I.D.: orchid.7328 Posted: Tue May 5 11:04:24 1987 Date-Received: Wed, 6-May-87 05:46:06 EDT References: <2645@phri.UUCP> <6454@mimsy.UUCP> <5797@brl-smoke.ARPA> <477@haddock.UUCP> Organization: U of Waterloo, Ontario Lines: 27 In article <477@haddock.UUCP>, karl@haddock.UUCP (Karl Heuer) writes: > In article <474@haddock.UUCP> karl@haddock.ISC.COM.UUCP (Karl Heuer) writes: > I suppose I should clarify this. The first "void" means "logically void", > i.e. a function with no return value; the second refers to the actual > declaration. For example, "int nullf() {}" is acceptable to the lint I just > tried, and is still legitimate in X3J11 unless they've changed recently. > (In my opinion, it should be retained for backward compatibility, but should > be marked as deprecated.) One of the lints we use here (on GCOS8 (approaching ANSI)) treats int func1(int a) { printf("%d", a); return;} func2(int a) { printf("%d", a); return;} quite differently. func2() is perfectly valid (except for ignoring the status returned by printf), but func1() causes a complaint that it was explicitly declared int but fails to return a value. Our modified BSD 4.3 lint has a /*GOTO*/ directive in the function declaration that indicates that the function never returns. e.g. extern /*GOTO*/ exit(); The /*NOTREACHED*/ directive is thus never needed (it never was very useful anyway since lint only gives warnings if you remember to use it). Such a directive really should be part of the language though since it would let the compiler generate better code. (And for those that have asked, no, our changes aren't yet in a form where we could send them out easily. Would anyone at Berkeley be interested in them?)