GCC Front End: Finding the location of a Symbol Definition

Charles Hardnett <hardnett@cc.gatech.edu>
2 Aug 2001 02:43:52 -0400

          From comp.compilers

Related articles
GCC Front End: Finding the location of a Symbol Definition hardnett@cc.gatech.edu (Charles Hardnett) (2001-08-02)
Re: GCC Front End: Finding the location of a Symbol Definition loewis@informatik.hu-berlin.de (Martin von Loewis) (2001-08-06)
| List of all articles for this month |

From: Charles Hardnett <hardnett@cc.gatech.edu>
Newsgroups: comp.compilers
Date: 2 Aug 2001 02:43:52 -0400
Organization: Georgia Institute of Technology
Keywords: GCC, question
Posted-Date: 02 Aug 2001 02:43:52 EDT


I am working on a research project that has led me to a problem in the
GCC front-end.

My Problem:

I am using the Pro64 compiler, and it uses the GCC frontend for C/C++. I
am doing some work that requires the source-to-whirl-to-source
translation. The problem I am currently experiencing is that the
resulting source code will regenerate the type definition for a
composite type i.e. a struct or union that is actually defined in a
library header file. So, when the new code is compiled I get a
redefinition error.


#include <sys/stat.h>

struct stat mbuf;

is translated into:

struct stat {
} mbuf;

And so now the #include and this definition conflict. This happens
because during the retranslation the module encounters stat for the
first time in the declaration of mbuf and then creates a declaration for

My Idea:

If the GCC frontend determines that struct stat is defined in another
location either a library or another file, then I want to preserve this
information to have the BE translator use it to determine whether or not
to create a definition of this type.

Does anyone have any idea of how / where I can get this kind of



Charles R. Hardnett CREST at Ga Tech www.crest.gatech.edu

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.