Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!amdcad!mozart.amd.com!proton!tim From: tim@proton.amd.com (Tim Olson) Newsgroups: comp.os.minix Subject: Re: C SYNTAX QUESTION Message-ID: <1991Feb1.155656.27244@mozart.amd.com> Date: 1 Feb 91 15:56:56 GMT References: <43415@nigel.ee.udel.edu> Sender: usenet@mozart.amd.com (Usenet News) Reply-To: tim@amd.com (Tim Olson) Organization: Advanced Micro Devices, Austin, TX Lines: 33 In article <43415@nigel.ee.udel.edu> HBO043%DJUKFA11.BITNET@cunyvm.cuny.edu (Christoph van Wuellen) writes: | Is this correct, and if so, why? | | test() | { | int i; | void void_function(); | | ... | | i ? void_function() : 0; | } | | In GNU GAS, file obstack.h, many macros of such type are declared, and | my c68/c386 compiler complains about that.. Yes, it should. void and int are incompatible types. | Of course, | | i ? void_function() : (void) 0; | | works. c68 knows that 0 is a legal pointer of any type in the Syntax, but | what about void? Yes, 0 is a legal pointer of any type, including void, but void_function() is of type "void", not "void *". -- -- Tim Olson Advanced Micro Devices (tim@amd.com)