Path: utzoo!attcan!uunet!munnari.oz.au!cluster!metro!news From: chii@ee.su.oz.au (Liang Chii ) Newsgroups: comp.lang.c Subject: The bug in Turbo C 2.0 Message-ID: <1990Mar14.174620.11101@metro.ucc.su.OZ.AU> Date: 14 Mar 90 17:46:20 GMT Reply-To: chii@ee.su.oz.au (Liang Chii ) Organization: Electrical Engineering, The University of Sydney, Australia Lines: 40 Hi, net reader, I found a bug in Turbo C, please reconfirm if it is truely a bug. ======= cut here ======= #include #include main() { float far *temp, fix; int i; temp = farmalloc(40); for(i = 0; i< 5; i++) scanf("%f", temp+i); } ===== end here ====== The above code does not work but with an error message : "floating point formats not linked" But, if we put another statement at the end of the program : scanf("%f", &fix); Now, re-compiler and link the code. It works ok. It is very obvious that the code "scanf("%f", &fix);" should not affect the about program like this. I believe there is a bug between farmalloc(farcalloc) and scanf("%f",...). That is what I found. ========================================================================== YungChii Liang, Power Electronics and Drives Group School of Electrical Engg., University of Sydney NSW 2006, Australia TEL: 02 692 2337 FAX: 02 692 3847 e-mail : chii@ee.su.oz.au oo chii@facet.ee.su.oz ^-^ o The man from Formosa chii@extro.ucc.su.oz.au (o o) ~