Opened 10 years ago
Closed 10 years ago
#7159 closed Bugs (fixed)
Text-lines are processed as if they were preprocessing directives
Reported by: | Owned by: | Hartmut Kaiser | |
---|---|---|---|
Milestone: | To Be Determined | Component: | wave |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
Wave treats some text-lines as if they were preprocessing directives. This behaviour is trigger by following code, which is an example taken from C99 standard, with an additional newline:
#define EMPTY EMPTY # include <file.h>
$ wave --c99 example.c example.c:3:7: error: could not find include file: file.h
Relevant part of C99 standard:
A preprocessing directive consists of a sequence of preprocessing tokens that satisfies the following constraints: The first token in the sequence is a # preprocessing token that (at the start of translation phase 4) is either the first character in the source file (optionally after white space containing no new-line characters) or that follows white space containing at least one new-line character.
It seems the same is true for other C/C++ standards, even if they do not specify that this conditions should occur at start of translation phase 4 (http://www.open-std.org/jtc1/sc22/wg14/docs/rr/dr_144.html).
(In [79684]) Fixed #7159: Text-lines are processed as if they were preprocessing directives