HAS ANYONE SEEN THIS BUG?
Anders Juul Munch
juul at diku.dk
Wed Apr 17 00:11:17 AEST 1991
cn at allgfx.agi.oz (Con Neri) writes:
>Hi netters,
> I havec been working with a friend developing some code using
>Turbo C++ V1.5 but only writing in standard C. We have been getting an error
>with a particular piece of code, namely
> fscanf(fp,"%f", &f);
> The runtime error is
> scanf: floating point formats not linked.
> Abnormal Program termination.
> Can some one shed some light on what this means? I can compile some
> other code with the same statement and yet have no errors. I am
> quite confused!!
>Hope someone out there can help.
[stuff deleted]
I experienced the same problem once, using Turbo C 2.0 and trying to
link "by hand" instead of having the integrated environment make
facility handle all that. The solution was simple: I went back to
linking from the integrated environment.
Somehow TC/TC++ is trying to be smart, and exclude all
the code to handle floating point (by having a scanf version with
and one without fp-handling), when the program doesn't use
fp arithmetic. The trouble is, as [vsf]scanf and [vsf]printf
functions are interpreters of the format string, this may be
difficult to detect. Somehow you need to make TC aware that
you are dealing with fp. I don't know how TC detects fp use.
Perhaps by looking for fp-variable declarations in that module?
Or fp math?
-- Anders Munch
More information about the Comp.lang.c
mailing list