Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!icdoc!sot-ecs!rhh88 From: rhh88@ecs.soton.ac.uk (Heywood RH) Newsgroups: comp.sys.acorn Subject: Strange things in C v3 Summary: Is this a bug? Message-ID: <7199@ecs.soton.ac.uk> Date: 18 Mar 91 10:25:15 GMT Sender: news@ecs.soton.ac.uk Lines: 50 A friend of mine has discovered something a little stange with the ansi c compiler. It seems that he could only get it to pass a float as a function param. if he used the new ansi syntax. If he used the old syntax it gave a compile error. Stange thing is that if he changed his float to a double it worked. Odd eh! I think this could count as a bug but I don't want to go round accusing people only to discover it my fault :-( Here is the example bit of code for you to try and compile to see :- void a_function( float ); void other_func( double ); void other_function( distance ) double distance; { printf("%f", distance ); } void a_function( a_number ) float a_number; { printf("%f", a_number ); } /* Change first line of this function to void a_function( float a_number ) to get it to compile. */ END I think that was how it went but I am doing this from memory. Hope this helps someone RIK ______________________________________________________ / \ / Richard Heywood (Rik) \ / rhh88@uk.ac.soton.ecs \ \ / \ The Spice must flow / \______________________________________________________/ There is no time like the present for postponing what you ought to be doing.