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

Arthur David Olson ado at elsie.UUCP
Mon Jun 6 08:04:17 AEST 1988


Here's another "help wanted on a comment to X3J11" request.  One of the
comments I sent in during the second public review period ran along these lines:

	Rationale, Sectioin 3.8.3, Page 64

	Description:
		Contains a sample keyword redefinition:
			#define void int
		along with a note that "The redefinitions of void and const
		could be useful in retrofitting more modern C code to an older
		implementation."

		Since the Standard requires a void * to have the same
		representation as a char *, and since a char * may not have the
		same representation as an int *, this definition seems
		suboptimal.

	Proposed Change:
		Change the above line to read
			#define void char

The response I received (was marked "Not an official X3J11 document"),
said that while "#define void char" might be better when it comes to pointers,
there were other cases where "#define void int" was better.  Can anyone give a
concrete example?
-- 
		Market swaps ends for Chinese native.  (5)
	ado at ncifcrf.gov			ADO is a trademark of Ampex.



More information about the Comp.lang.c mailing list