[cfe-dev] Problem in locations

Abramo Bagnara abramobagnara at tin.it
Wed Aug 12 08:04:04 PDT 2009


If I try to compile the attached program I get:

$ ~/llvm/Debug/bin/clang-cc -pedantic -std=c89 z.c
z.c:2:9: warning: variable declaration in for loop is a C99-specific feature
  for ( \
        ^
1 diagnostic generated.

The token start is not indicated in the position of the "i" of "int" but
in the previous line and the token length is set to 5.

Is it intentional or it is a bug?

IMHO to have a leading \newline as part of the token confuses the
diagnostic without benefits.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: z.c
Type: text/x-c++
Size: 64 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090812/a6eda7f6/attachment.bin>


More information about the cfe-dev mailing list