[GCC-XML]Substituing gccxml to gcc

Brad King brad.king at kitware.com
Tue Mar 30 13:29:15 EST 2004


Sébastien Pierre wrote:
> Hi all,
> 
> I recently came across gccxml in my quest for a way to create a 
> structural representation for a program written in C and C++. My aim is 
> to create a graph where nodes are functions, classes and namespaces, and 
> where function calls are represented by arcs between function nodes.
> 
> I tried the example given in the "Running" page of the gccxml website, 
> which worked fine. Then I added an "#include <stdio.h>" and added a 
> "printf("Hello World!\n");" in the `a_function' code, to see if a 
> function body (and in my case, calls to functions) were represented in 
> the XML output.
> 
> At first, gccxml did not found stdio.h :
> example1.c:1:19: no include path in which to find stdio.h
> 
> Then I added -I/usr/include, which gave me a bunch or errors.
> 
> So I have some questions to the gccxml experts :
> 
> - Is gccxml able to parse C code (not C++) ?

Yes, this should work fine, and you should not have to add any -I 
options.  What is the output of the command line you tried, but with the 
"--print" option added?

> - Does gccxml represent calls to other functions within a function body ?

No function bodies are dumped at all:

http://www.gccxml.org/HTML/FAQ.html

-Brad




More information about the gccxml mailing list