[cfe-dev] clang omits a part of the code

Nir Pluderman nirpl at bgu.ac.il
Fri Mar 25 04:31:08 PDT 2011


Thank you for your quick response Peter,

I did as you said, and this is the output I got:

    Stack dump:
    0.    /usr/include/stdio.h:34:3: current parser token 'include'
    
It's a standard library header which comes builtin in ubuntu.

Also,    
If I switch the order of the includes in the file from:
    #include <stdio.h>
    #include <stdlib.h>
    
to:
    #include <stdlib.h>
    #include <stdio.h>
    
I get the output:
    
    Stack dump:
    0.    /usr/include/stdlib.h:33:2: current parser token 'include'
    
Again, It's a standard library header. 

Is there anything I can do about it?

note:
    In both cases the problematic line in these standard library headers is: 
        #include <stddef.h>

----- Original Message -----
From: Peter Collingbourne <peter at pcc.me.uk>
Date: Thursday, March 24, 2011 12:50
Subject: Re: [cfe-dev] clang omits a part of the code
To: Nir Pluderman <nirpl at bgu.ac.il>
Cc: cfe-dev at cs.uiuc.edu

> On Thu, Mar 24, 2011 at 01:38:52PM +0000, Nir Pluderman wrote:
> >    Does anyone have any idea what I'm doing wrong?
> 
> Most likely one of your header files is causing an error diagnostic
> to be emitted.  If a malformed input file is provided then 
> Clang will
> try to build as complete an AST as possible.
> 
> > 	diags->setSuppressAllDiagnostics(true);
> 
> If you remove this line then you should be able to see the
> diagnostic(s).
> 
> Thanks,
> -- 
> Peter
>-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110325/7038c6dd/attachment.html>


More information about the cfe-dev mailing list