🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Arthur David Olson Sat, 01 Nov 1986 17:43
#define CTRL(x) followup
#9698
Author: Arthur David Olson
Date: Sat, 01 Nov 1986 17:43
31 lines
1325 bytes
Thanks to everyone who replied to my question on whether an emulation of
Reiser cpp's handling of

	#define CTRL(x) ('x' & 037)

could be done in tentative proposed draft ANSI C.
The consensus is that the closest one came come is

	#define CTRL(x) (#x[0] & 037)

with, perhaps, a "const" cast of appropriate type thrown in to allow for uses
such as

		...
		switch (input_char) {
			case CTRL(z):	stop();
		...

And an idea for consideration:  "lint" now reports on function arguments that
are not used; if it were extended to report on macro arguments that were not
used, then old, Reiser-style constructs such as

	#define CTRL(x) ('x' & 037)

would result in "lint" warnings.
--
ANSI may be a trademark of ANSI.
Lint is a trademark of Oscar Madison.
--
	UUCP: ..decvax!seismo!elsie!ado   ARPA: elsie!ado@seismo.ARPA
	DEC, VAX, Elsie & Ado are Digital, Borden & Ampex trademarks.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads