Xref: utzoo comp.lang.modula2:811 comp.lang.misc:1492 comp.lang.c:9564 comp.lang.pascal:835 Newsgroups: comp.lang.modula2,comp.lang.misc,comp.lang.c,comp.lang.pascal Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Modula2's godawful IO. Message-ID: <1988Apr24.010212.3536@utzoo.uucp> Organization: U of Toronto Zoology References: <764@ndsuvax.UUCP> <535@m10ux.UUCP> <730@mhuxm.UUCP> <11154@mimsy.UUCP>, <588@vsi.UUCP> Date: Sun, 24 Apr 88 01:02:12 GMT > ... 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? ... Onyx borrowed this from the original pdp11 C implementation, in fact, which used this technique to pick up a non-floating-point printf if floating point was not in use. It didn't even require any special trickery in the linker: generate an external reference to fltused when floating-point is used; have two versions of the internal floating-point-formatting function, one which implements the full show and also defines fltused and one which does the integer subset and doesn't define fltused; and arrange for the fltused version to be seen by the linker before printf and the non-fltused version are seen. > ... It seems so much more reasonable than the ubiquitous "-f" flag. It's a reasonable substitute for -f only if you assume that the hardware never has proper floating-point support, or if you don't care about hauling the floating-point software along unnecessarily. The Onyx came under the former heading, as I recall. -- "Noalias must go. This is | Henry Spencer @ U of Toronto Zoology non-negotiable." --DMR | {ihnp4,decvax,uunet!mnetor}!utzoo!henry