Issue Details (XML | Word | Printable)

Key: PCC-278
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.

newline should close string literals (in preprocessor)

Created: 16/Mar/11 10:43 AM   Updated: 19/Mar/11 10:32 AM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File diff (0.6 kB)

Environment: NetBSD/i386

 Description  « Hide
during the preprocessing phase, an unescaped newline should close a string literal, for example

#define foo FOO

" foo

when passed through "pcc -E" should substitute the second foo, producing

" foo

this affects distributions such as X11 which uses the C preprocessor to substitute keywords in manpages which have .\" as comment marker.. cpp enters string literal mode at the first occurrence and never exits, causing no substitutions to be done.

(Xorg seem to be moving away from cpp for this, but there are still usages)

incidentally, as the file is ended in string literal mode, there is a spurious 0xff character output at the end

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Iain Hibbert added a comment - 17/Mar/11 11:43 AM
the attached diff seems to fix these issues

Anders Magnusson added a comment - 19/Mar/11 10:32 AM
Fixed, thanks. I also repaired line number counting and \\n while here.