Path: utzoo!attcan!uunet!datapg!viper!dave From: dave@viper.Lynx.MN.Org (David Messer) Newsgroups: comp.unix.microport Subject: Floating exception bug Message-ID: <1656@viper.Lynx.MN.Org> Date: 2 Dec 88 04:05:14 GMT Reply-To: dave@viper (David Messer) Organization: Lynx Data Systems, Eagan, MN Lines: 38 I don't know if this has been reported yet, but the following code causes a "Floating exception error" and a core dump when run in a system with an 80287 co-processor. (I don't know if it generates an error when floating point operations are emulated with software.) ------File x.c main() { /*extern double y();*/ for(;;) { y() ; } } ------File y.c double y() { return( 1.0 ) ; } ------ Compile with: cc x.c y.c and execute a.out. The fix is to uncomment "extern double y();" in main(). Since the value returned from y() is not used, no extern definition should be required. Apparently if the function is not declared double, it uses up resources in the floating-point chip which eventually causes an error. It was a real bear to find because the error could occur on any floating-point operation once the resources got too low. -- _____________________________________________________________________________ __ _ _ _ David Messer - Lynx Data Systems / ) / ' ) ) ) dave@Lynx.MN.Org -or- / / __. , __o __/ / / / _ _ _ _ __ ...{amdahl,hpda}!bungia! /__/_(_/|_\\/ <__(_/_ / ' (_