Issue Details (XML | Word | Printable)

Key: PCC-365
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Anders Magnusson
Reporter: Anthony Mallet
Votes: 0
Watchers: 1
Operations

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

chknl() fail to detect eof

Created: 29/Jun/11 05:01 PM   Updated: 06/Jul/11 06:03 PM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File patch (0.7 kB)



 Description  « Hide
chknl() fail to detect eof, and prints the followin warning:
warning: newline expected, got "�" (where the char in question is 255)

The fix is trivial: check for a return of 0 in sloscan(). However, sloscan() might also return (usch)-1 (i.e. 255) because it can happen that unch() has been called beforehand with a value of -1 returned by sloscan(), and unch(-1) actually pushes back 255.

See the attached patch for a fix (hopefully more formal than my tentative explanation above :)


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anthony Mallet added a comment - 29/Jun/11 05:11 PM
I should have said that this happens when a # directive is on the last (unterminated) line, e.g:
#endif<missing \n>

Anders Magnusson added a comment - 06/Jul/11 06:03 PM
Great, thanks, applied!