Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!DLD.AVALON.CS.CMU.EDU!David.Detlefs From: David.Detlefs@DLD.AVALON.CS.CMU.EDU Newsgroups: gnu.g++.bug Subject: overloading problem Message-ID: <8907250055.AA12967@AENEAS.MIT.EDU> Date: 24 Jul 89 22:40:41 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 39 I'm using g++ 1.35 on a vax. I extracted the following file from libg++'s "compare.h": -------------------------------------------------- // This should work but doesn't. inline int compare(int a, int b) { return a - b; } inline int compare(float a, float b) { float x = a - b; return (x > 0.0 ? 1 : (x < 0.0 ? -1 : 0)); } -------------------------------------------------- Attempting to compile this produced the error message: In function int compare (float, float): bug2.cc:9: conflicting types for `int compare (float, float)' I then backed off to just declarations: -------------------------------------------------- // This should *really* work but doesn't. int compare(int a, int b); int compare(float a, float b); -------------------------------------------------- Result: bug2b.cc:4: conflicting types for `int compare (float, float)' -- Dave