Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!kd4nc!rbdc!barry From: barry@rbdc (Barry Newberry) Newsgroups: comp.sys.apple2 Subject: Orca/C bug (void functions) Summary: compiler chokes on type void functions Message-ID: <1991Apr6.083344.26760@rbdc> Date: 6 Apr 91 08:33:44 GMT Reply-To: barry@rbdc.UUCP (Barry Newberry) Distribution: usa Organization: N.C. Home for Deranged Programmers Lines: 36 It appears that an old bug (feature?) has been left in Orca/C. Of course, I never wrote Mike (W.) about it, because I thought someone else would (my mistake). The compiler won't allow called functions to be type void. The compiler blames the next line of code for the problem. From what I've read, ANSI C allows functions to be type void, so I shouldn't have any trouble with the following program. Changing type void functions to type int takes care of the problems, but I like to use void for functions which can't have errors or don't have to return values. /****************strange C program**************/ void main (void) { thing (); } void thing (void) { } /***************an attempt to compile***********/ ORCA/C 1.2 Compiling main Compiling thing 7 { ^ duplicate symbol /***************end of stuff********************/ I guess I'll have to play with the compiler to see how extern Assembly functions are affected. Changing an Assembly function from void to int means I'll have to return a value on the stack (what a waste :-)). -- ------------------------------------------------------------------------- Remember, until there is a cure for Assembly Language Brain Fry, there will always be the N.C. Home for Deranged Programmers. -----------------------------------------------------------------------