Machine specific predefined names

Doug Gwyn gwyn at brl-smoke.ARPA
Mon Feb 22 21:19:38 AEST 1988


In article <17033 at watmath.waterloo.edu> rbutterworth at watmath.waterloo.edu (Ray Butterworth) writes:
>    #include <stdlib.h>
>    #include <stdio.h>
>    int putchar(int n) { abort(n); }
>    main() { perror("xx"); }
>Now if perror() needs putchar() to write the message, will it use
>my version of putchar or an internal version, say _putchar()?

This wasn't a good example; putchar is a macro.  Even if you #undef it,
perror will not call a putchar function since it used the macro.

Assuming you change this to an example using strcmp(), for example,
then the answer is that your application does not conform to the
standard because it defines an external name that is reserved for
the implementation.

DISCLAIMER:  The above is my own personal interpretation of things.



More information about the Comp.lang.c mailing list