TC++: "floating point formats not linked"

Doug Gwyn gwyn at smoke.brl.mil
Tue Feb 26 03:55:25 AEST 1991


In article <268 at nazgul.UUCP> bright at nazgul.UUCP (Walter Bright) writes:
>I'm all ears if anyone has a suggestion on how to get the best of both
>by default.

What I did when I maintained the Ritchie PDP-11 C compiler was to arrange
for the compiler to generate a reference to some symbol like "__fltused"
whenever there was ANY use of floating point, even simply a
declaration of a type whose base type was float or double, in a
translation unit.  Of course the system C library was set up so that a
reference to "__fltused" caused the full format support to be linked
rather than the usual integer-only format support object module.

You could of course also have the compiler pay special attention to the
format strings for *scanf() and *printf(), although that is not foolproof.



More information about the Comp.lang.c mailing list