Xref: utzoo comp.lang.c:32774 comp.lang.c++:9900 comp.os.msdos.misc:436 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!usna!baldwin From: baldwin@usna.NAVY.MIL (J.D. Baldwin.) Newsgroups: comp.lang.c,comp.lang.c++,comp.os.msdos.misc Subject: Re: scanf() problem in Turbo C++ 1.00 but NOT in Turbo C 2.01 Summary: everybody's entitled to one screwup Keywords: calloc scanf float double estupido Message-ID: <346@usna.NAVY.MIL> Date: 11 Oct 90 01:55:43 GMT References: <344@usna.NAVY.MIL> Reply-To: baldwin@cad.usna.mil (J.D. Baldwin) Followup-To: comp.lang.c Organization: Canoe U. Lines: 50 In article <344@usna.NAVY.MIL> I, with brain engaged firmly in neutral, wrote: [a bunch of code and text describing a problem in which] > > scanf("%lf", &(ar_1[0])); [resulted in] > > scanf : floating point formats not linked > Abnormal program termination Within hours, several people from across the nation answered me with "Yeah! I got something like that, too! I dunno why." This makes me feel much better--I wasn't the only one who hadn't read the FAQ list thoroughly recently. It took a Mr. Karl Heuer, of Interactive Systems, Cambridge, MA to set me straight by quoting, of all things, the FAQ list. The perceptive Mr. Heuer clearly knew that I must feel like a buffoon and kindly did not dwell on my error. I really *do* read these things. I swear. This one got by me. It's worth repeating here for those others (and now I know you're out there): >65. I'm having trouble with a Turbo C program which crashes and says > something like "floating point not loaded." > >A: Some compilers for small machines, including Turbo C and Ritchie's > original pdp11 compiler, attempt to leave out floating point support > if it looks like it will not be needed. In particular, the non- > floating-point versions of printf and scanf save space by not > including code to handle %e, %f, and %g. Occasionally the > heuristics for "is the program using floating point?" are > insufficient, and the programmer must insert one dummy explicit > floating-point operation to force loading of floating-point support. > Unfortunately, an apparently common sort of program (thus the > frequency of the question) uses scanf to read, and/or printf to > print, floating-point values upon which no arithmetic is done, which > elicits the problem under Turbo C. > > In general, questions about a particular compiler are inappropriate > for comp.lang.c . Problems with PC compilers, for instance, will > find a more receptive audience in a PC newsgroup. Apologies to the net. Thanks to Mr. Heuer. -- From the catapult of: |+| "If anyone disagrees with anything I _, J. D. Baldwin, Comp Sci Dept |+| say, I am quite prepared not only to __||____:::)=}- U.S. Naval Academy|+| retract it, but also to deny under \ / baldwin@cad.usna.navy.mil |+| oath that I ever said it." --T. Lehrer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~