Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Static analysis of C code including preprocessor statements?
Static analysis of C code including preprocessor statements? [message #109266] Fri, 17 August 2007 08:52 Go to next message
Hendrik David Post is currently offline Hendrik David PostFriend
Messages: 2
Registered: July 2009
Junior Member
Hi All,

I am developing static analysis tools for C using the CDT parser. I have
the following problem:

Example:
#if 0
i++;
#endif

How can I get a parse tree for the "i++;" statement? The parser detects
that this statement is unreachable, but I need to cover all C code (when
checking coding styles etc.).

Has anybody solved this problem?

Cheers,

Hendrik
Re: Static analysis of C code including preprocessor statements? [message #112539 is a reply to message #109266] Mon, 17 September 2007 11:27 Go to previous message
Steve Gutz is currently offline Steve GutzFriend
Messages: 70
Registered: July 2009
Member
We use CDT to parse the code. Currently there are a few limitations with
CDT's parser which impact the ability tp parse into code inside compiler
directives. We are trying to resolve this with the CDT team but it's going
to take some time.

Steve

"Hendrik" <hendrik@hangschaf.de> wrote in message
news:fa3njk$jje$1@build.eclipse.org...
>
> Hi All,
>
> I am developing static analysis tools for C using the CDT parser. I have
> the following problem:
>
> Example:
> #if 0
> i++;
> #endif
>
> How can I get a parse tree for the "i++;" statement? The parser detects
> that this statement is unreachable, but I need to cover all C code (when
> checking coding styles etc.).
>
> Has anybody solved this problem?
>
> Cheers,
>
> Hendrik
Previous Topic:Where is AGR
Next Topic:Connection on Localhost failed
Goto Forum:
  


Current Time: Sat Apr 27 00:33:59 GMT 2024

Powered by FUDForum. Page generated in 0.03319 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top