Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!nic.MR.NET!umn-cs!mmm!manning From: manning@mmm.UUCP (Arthur T. Manning) Newsgroups: comp.os.os9 Subject: Re: printf bug with C compiler...fatal runtime error! Message-ID: <1225@mmm.UUCP> Date: 30 Jan 89 14:38:34 GMT References: <1223@mmm.UUCP> Reply-To: manning@mmm.UUCP (Arthur T. Manning) Distribution: usa Organization: 3M Company - Software and Electronics Resource Center (SERC); St. Paul, MN Lines: 37 /* I received this explation from David West of Microware (515-224-1929): "The problem demonstrated by the program above is a known bug in the Microware C library and will be corrected in the next release (version 3.1). [It may be possible to patch the bug depending on C compiler and operating system versions.]" */ #include main() { double x = 123.45; double *double_ptr = &x; short *short_ptr = (short *)&x; printf("double is %5.2f\n",x); *short_ptr = 0x6666; /* this must make x an illegally formatted double? */ printf("double is now -->"); fflush(stdout); /* this program appears to crash at this point */ printf("%5.2f\n",x); printf("\nprogram complete!\n\n"); } -- Arthur T. Manning Phone: 612-733-4401 3M Center 518-1 FAX: 612-736-3122 St. Paul MN 55144-1000 U.S.A. Email: manning@mmm.uucp