[cfe-dev] Line directives in Clang vs GCC

kirbyfan64sos rymg19 at gmail.com
Fri Jul 10 20:32:02 PDT 2015


I posted this on  Stack Overflow
<http://stackoverflow.com/questions/31352011/clang-line-directive>  , but I
just got 1 downvote (technically 2, but I also got 1 upvote) and 3 close
votes. So...yeah. :/

Basically, I have ln.x:

abc

And ln.cpp

#line 1 "ln.x"
(

GCC prints the corresponding line of ln.x:

ln.x:1:1: error: expected unqualified-id at end of input
 abc
 ^
ln.x:1:1: error: expected ‘)’ at end of input

But Clang simply prints the line in ln.cpp:

ln.x:1:2: error: expected unqualified-id
(
 ^
ln.x:1:2: error: expected ')'
ln.x:1:1: note: to match this '('
(
^
2 errors generated.

Is there a way to achieve the GCC behavior in Clang?




--
View this message in context: http://clang-developers.42468.n3.nabble.com/Line-directives-in-Clang-vs-GCC-tp4046494.html
Sent from the Clang Developers mailing list archive at Nabble.com.




More information about the cfe-dev mailing list