Issue Details (XML | Word | Printable)

Key: PCC-321
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

spurious space in output (preprocessor)

Created: 18/Apr/11 09:47 AM   Updated: 18/Apr/11 06:28 PM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386

 Description  « Hide
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

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 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.