Modula2's godawful IO.
Stephen J. Friedl
friedl at vsi.UUCP
Fri Apr 22 12:50:02 AEST 1988
In article <11154 at mimsy.UUCP>, chris at mimsy.UUCP (Chris Torek) writes:
> It is not difficult[*] to arrange for the linker to pull in a simple
> printf() if the rest of the program does not use floating point, and a
> full-blown floating point printf if it does. [....]
>
> [*]What, never? Well, hardly ever. The trick is to have the linker
> examine the undefined externals for floating-point library references,
> and if present, link with `bigprintf.obj'; otherwise it should use
> `littleprintf.obj'. It is just a Small Matter of Programming.
This brings up an interesting question. The C compiler on the
Onyx Z8000 (R.I.P.) would generate a symbol "_fltused" if any
floating point of any kind was used in that particular module.
When the linker went to resolve everything, it loaded in the
floating-point emulator if this symbol was found and didn't if it
wasn't. As far as I could tell, this symbol was nothing more
than a indicator to ld(1). Does anybody else do this? It seems
so much more reasonable than the ubiquitous "-f" flag.
--
Steve Friedl V-Systems, Inc. Resident access(2) basher
friedl at vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl
More information about the Comp.lang.c
mailing list