Issue Details (XML | Word | Printable)

Key: PCC-281
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0

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

character constant terminations (preprocessor)

Created: 17/Mar/11 09:30 AM   Updated: 19/Mar/11 10:16 AM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File diff (0.5 kB)

Environment: NetBSD/i386

 Description  « Hide
character constant early termination (newline, eof) is not handled correctly in the preprocessor, consider the following cases

' foo

' foo<EOF>

' foo\<EOF>

will produce the following outputs

' foo


(spurious newline)

' fooÿ

(0xff character)

' fooÿÿ

(0xff character twice)

the attached patch for token.c corrects these cases

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 19/Mar/11 10:16 AM
Fixed, thanks for the patch. I also added some code for handling of \\n inside character constants.