Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/cpp-bad-stringify/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


The following code :

	#define hash_hash # ## #
	#define mkstr(a) # a
	#define in_between(a) mkstr(a)
	#define join(c, d) in_between(c hash_hash d)

	char p[] = join(x, y);

should produce :

	char p[] = "x ## y";

instead of :

	char p[] = "xy";

I think stringify() is called too many. That's why I propose this fix.
However, even though it fixes this problem, I cannot tell you of any collateral damages ;)

Phil;

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].