Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site cwruecmp.UUCP Path: utzoo!linus!decvax!cwruecmp!decot From: decot@cwruecmp.UUCP (Dave Decot) Newsgroups: net.lang.c Subject: Re: void casts; and C definition question Message-ID: <687@cwruecmp.UUCP> Date: Thu, 6-Oct-83 21:08:34 EDT Article-I.D.: cwruecmp.687 Posted: Thu Oct 6 21:08:34 1983 Date-Received: Sat, 8-Oct-83 07:06:47 EDT References: wjh12.327, <5973@unc.UUCP> Organization: CWRU Computer Engr. Cleveland, Ohio Lines: 29 The form (void) foo(x); as a statement intended to "throw away" the value returned by foo(x) IS correct, because it is a CAST operation on the expression foo(x); which (apparently) has some non-void value. The expression (void) foo(x); still does have a "value" of sorts, but the "value" is of type void, whose "conversion" rules are that any attempt to convert its values to any other type (or to otherwise use void "values") is an error. It is an therefore an ERROR to ask for ((void) foo)(x); because an expression of type void, i.e. ((void) foo) cannot be where a function pointer (like foo) is required. Dave Decot ..!decvax!cwruecmp!decot