[cfe-dev] Line directives in Clang vs GCC

Richard Smith richard at metafoo.co.uk
Fri Jul 10 21:50:31 PDT 2015


What are you really trying to do?
On 10 Jul 2015 8:32 pm, "kirbyfan64sos" <rymg19 at gmail.com> wrote:

> 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.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150710/6a7fe930/attachment.html>


More information about the cfe-dev mailing list