top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Parsing C enum/structure/union/arrays using -fdump-translation-unit of GCC

+1 vote
374 views

I am using the -fdump-translation-unit option of GCC to parse C enum/structure/union/arrays. Consider the below code

enum eDAY
{
 monday = 0,
 tuesday,
 wednesday
};

enum eDAY day = monday;

I can get all the members of the enumerator parsing the dump of GCC. But if the below declaration was not present

enum eDAY day = monday;

GCC's dump doesn't have any information about the members of the enumerator. The same problem exists with structures/unions etc. How can I solve this problem. Is there some kind of optimization flag which I need to turn off so that GCC parses all the objects even if it is not used ?

posted Jul 31, 2013 by Deepak Dasgupta

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

I'm studying about C compiler for increasing software quality. So I want to get all of compile error message list of gcc about C language. I was trying to find it. But I can't find it anywhere. How can I find it?

Please help?

+1 vote

I wanted to ask what is the GCC C++ equivalent implementation of Windows _ MyFirst and _MyLast vector pointers?

These give direct access to the vectors first and last element, but they are not present in the GCC implementation of the vector class.

+1 vote
  1. GCC is available in several variations (SJLJ, DW2, SEH). When compiling plain C code (therefore either assuming or explicitly specifying -fno-exceptions), does it make any difference which GCC variation is used?

  2. Further I assume, that if my plain C code was to link to a C++ library which may throw exceptions, then it would matter which GCC variation I use. In that case, I should use the GCC variation that matches with the C++ code exception flavour, I should enable -fexceptions when compiling my plain C code, and the exceptions could
    then propagate over the C code?

...