Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hplabs!hpcc01!hpcuhb!hpcllla!hpclisp!hpclscu!shankar From: shankar@hpclscu.HP.COM (Shankar Unni) Newsgroups: comp.lang.c++ Subject: cfront 2.* mishandles "if (funcname)" statement Message-ID: <58170025@hpclscu.HP.COM> Date: 5 Jun 90 19:29:47 GMT Organization: Hewlett-Packard Calif. Language Lab Lines: 33 Looks like cfront has a hard time dealing with function pointers in conditional expressions. For instance: extern int foo(); main() { if (foo) { /* ... */ } } "foo.c", line 4: function != zero Similar messages are put out when the function is used in other conditional contexts. The workaround seems to be to specify if (&foo) { } From my reading of section 4.6 of the 2.0 (and 2.1) reference manuals ("Pointer conversions"), the expression "foo" should get a type of "pointer to function" (since I am neither calling it, nor applying an "&" operator to it). Is this a cfront bug, or am I missing something? Cfront even seems to be going out of its way to put out this message... ----- Shankar Unni E-Mail: Hewlett-Packard California Language Lab. Internet: shankar@hpda.hp.com Phone : (408) 447-5797 UUCP: ...!hplabs!hpda!shankar