Bug in NodeInfo for CTranslUnit

Erik de Castro Lopo mle+hs at mega-nerd.com
Thu Feb 26 04:05:55 EST 2009

Hi all,

Consider the following tiny program, in a file called say "main.c":

    #include <stdio.h>
    int main (void)
        puts ("Hello!") ;
        return 0 ;

If one parses that file and passes the resulting CTranslUnit to
this function:

    printFileName :: CTranslUnit -> IO ()
    printFileName (CTranslUnit _ ni) =
        putStrLn $ posFile $ posOf ni

the answer printed is in my case:


rather than "main.c".

It seems that <stddef.h> is the first file included by <stdio.h>.

Would this be consided a bug? Anyone care to fix it or apply  a
patch if I fix it?

Erik de Castro Lopo
"I'd love to see a conference where Islamic and Christian creationists
argue with each other on whose interpretation of God's will is actually
correct." -- Brian Smith

More information about the Language-c mailing list