Mail Archives: djgpp-workers/1998/12/05/12:19:27
> It seems to me that the issue is not so much the library routine polluting
> the ANSI namespace (since the global name "pow2" still exists in the stub)
No, it's exactly this. The pollution happens if an ANSI function
(like fopen) uses a non-ANSI function (like open). A program written
to expect ANSI might call fopen() yet have its own function open()
that does something completely unrelated (say, indicate that a door is
open). ANSI says they *can* expect that.
Thus, if you put both labels on the internal open function (both
_open: and ___open:), then any DJGPP ANSI function calling __open()
makes it impossible for the user's program to have a function called
open(), even though the ANSI spec says they can.
So, the rule is this: ANSI functions may not, directly or indirectly,
call (or cause to be linked) any function (or other global symbol)
whose name isn't allowed by the ANSI spec. POSIX functions may not,
directly or indirectly, call (or cause to be linked) any function (or
other global symbol) whose name isn't allowed by either the ANSI nor
POSIX specs.
- Raw text -