Bug in NodeInfo for CTranslUnit
Benedikt Huber
benedikt.huber at gmail.com
Thu Feb 26 04:26:20 EST 2009
Hi Erik,
thanks for the report (http://www.sivity.net/projects/language.c/ticket/32
).
On 26.02.2009, at 10:05, Erik de Castro Lopo wrote:
> Hi all,
>
> [..]
> printFileName (CTranslUnit _ ni) =
> putStrLn $ posFile $ posOf ni
>
> the answer printed is in my case:
>
> /usr/lib/gcc/i486-linux-gnu/4.3.2/include/stddef.h
>
> rather than "main.c".
>
> Would this be consided a bug? Anyone care to fix it or apply a
> patch if I fix it?
The reason for this 'bug' is that the first token of the translation
unit is not in 'test.c' but some system header. We could change the
file of CTranslUnit anyway, it agree that it is more appropriate. But
I guess it will need a rather ugly 'special case' hack, because
currently all but the last in a list of consecutive line pragmas is
dropped by the lexer.
benedikt
More information about the Language-c
mailing list