Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!mcnc!rti!dg-rtp!throopw From: throopw@dg-rtp.UUCP (Wayne A. Throop) Newsgroups: comp.lang.c Subject: Re: Type checking in conditional expressions Message-ID: <342@dg-rtp.UUCP> Date: Mon, 19-Oct-87 19:01:45 EDT Article-I.D.: dg-rtp.342 Posted: Mon Oct 19 19:01:45 1987 Date-Received: Wed, 21-Oct-87 00:05:51 EDT References: <186@wright.EDU> Organization: Data General, RTP NC. Lines: 20 > jholbach@wright.EDU (Jim Holbach) > To provide [better typechecking] I created some macros of the form > #define PROCNAME(a,b) procname(0?dummy_a:(a),0?dummy_b:(b)) > [...] I have a function which expects > a function to be passed to it. So my dummy variable is declared as > "void (*dummy_func)()". But when I invoke the macro using the name > of the function as an argument, the compiler complains > "operands of : have incompatible types". This is a symptom of pcc's odd and hacked-in treatment of the void type. Our non-pcc-based compiler gets this correct, as does our non-pcc-based typechecker, but lint barfs all over it. If "void" is replaced by "int", the problem goes away. Suggestion: some of the fixes Guy Harris has posted over the last few years to pcc and lint may make the problem go away. -- The seeds of crime bear bitter fruit. --- Dick Tracy -- Wayne Throop !mcnc!rti!xyzzy!throopw