Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site wjh12.UUCP Path: utzoo!linus!vaxine!wjh12!kendall From: kendall@wjh12.UUCP (Sam Kendall) Newsgroups: net.lang.c Subject: Re: Re: void casts; and C definition question Message-ID: <328@wjh12.UUCP> Date: Wed, 5-Oct-83 01:13:32 EDT Article-I.D.: wjh12.328 Posted: Wed Oct 5 01:13:32 1983 Date-Received: Fri, 7-Oct-83 03:14:14 EDT References: <1236@rlgvax.UUCP> Organization: Delft Consulting Corp., New York Lines: 39 The language should *not* guarantee that calling a function without having properly declared the type of the function's return value should work, because not all implementations can guarantee this. If pointers and "int"s are different sizes... if you don't say "char *malloc()" or whatever you are *guaranteed* to lose. Guy Harris You're absolutely right. In my news item I was referring only to cases in which the function is defined to return some type, possibly a structure, but not declared (in another file) to do so, AND the return value in that file is ignored; and to the language definition issues raised by such examples. But I didn't make this distinction clear in my news item. An example of what I mean: File "a.c": struct a f() { ... } File "b.c": /* no declaration of f() */ ... f(); /* call to f, return value ignored */ ... This example will fail on those machines which use a hidden first argument to implement structure returning. But this same lack of declaration is common for functions which return something other than structures, functions whose return values are often ignored anyway, such as strcpy(). My question, then, is what should be guaranteed for such things. Along these lines, I'd like to see a lint(1) option to warn about default function and formal parameter declarations, even though they are part of the language. Sam Kendall {allegra,ihnp4}!wjh12!kendall Delft Consulting Corporation decvax!genrad!wjh12!kendall