<< Back to previous view

[PCC-321] spurious space in output (preprocessor) Created: 18/Apr/11  Updated: 18/Apr/11

Status: Closed
Project: pcc
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Iain Hibbert Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: NetBSD/i386

the following code

#define A aaa
#define B \o/


when passed to the preprocessor, produces the following output

> \o/<

note the spurious space introduced when the definition starts with a non-text
character. Looking at the source for this its probably related to EBLOCK but I'm not
sure if this behaviour is intentional as I don't see where it came from, the space
doesn't seem to be stored in the macro buffer

Comment by Anders Magnusson [ 18/Apr/11 06:28 PM ]
This is actually intentional and was added in cpp.c:1.117: macro replacement is not allowed to create new tokens. See:
#define A -1

should not result in --1, therefore a space is inserted between.
Generated at Wed Nov 25 23:23:17 CET 2015 using JIRA Enterprise Edition, Version: 3.13.1-#333.