More ANSI comment help wanted: #define void int vs. #define void char

Doug Gwyn gwyn at brl-smoke.ARPA
Tue Jun 7 18:20:32 AEST 1988


In article <8087 at elsie.UUCP> ado at elsie.UUCP (Arthur David Olson) writes:
>If someone could explain the error possibly being introduced here,
>I'd appreciate it.

"extern char exit();" is plain wrong on EVERYbody's system.  Whether
or not this causes a problem depends on the implementation.
If a header is included that has e.g. "extern exit();" in it
then there is a type clash, too.

I just spent a whole (long) day hand-editing some C++ output C code
sent to me from a system that had globally mapped "void" to "char".
This was not a lot of fun, because some of the "char"s were correct
and some weren't.  In fact, most of them weren't.  I had to study the
context of each "char" to determine what to do.  (I turned most of
them back into "void" since the only problem with my compiler was
lack of support for "void *".)



More information about the Comp.lang.c mailing list