Machine specific predefined names
Karl Heuer
karl at haddock.ISC.COM
Sat Apr 2 12:26:08 AEST 1988
In article <5202 at sdcrdcf.UUCP> markb at sdcrdcf.UUCP (Mark Biggar) writes:
>In article <3264 at haddock.ISC.COM> karl at haddock.ima.isc.com (Karl Heuer) writes:
>>That isn't portable. After you've redefined something, you have no way of
>>knowing whether other library routines (e.g. puts) will be using your
>>putchar or the standard one.
>
>I thought the standard included a guarantee that if you did the above that
>the libraries would still continue to use the original definition.
>In fact the whole reason for the necessity of using the #undef etc. was to
>allow for that guarantee.
No, it's guaranteed that the libraries will not depend on NON-standard
functions (e.g. you can safely use "open" without worrying that "fopen" calls
a function of that name), but the names of the standard routines are reserved.
(Note: "putchar" is a bad example, because it happens to work in the usual
implementation. But "malloc" does not, and neither does "putc".)
Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint
More information about the Comp.lang.c
mailing list