Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > compiler options to display types?

Reply
Thread Tools

compiler options to display types?

 
 
bsd_mike
Guest
Posts: n/a
 
      10-13-2005

I am working with some purchased source code which
contains types which are structures which themselves
contain structures and even more structures.
Each field in the structure is itself its own datatype.

Is there a tool I can use that I can wrap a structure
and have it dump out the composition based on basic
types?

Thanks,
Mike

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      10-13-2005
In article < .com>,
bsd_mike <> wrote:

>I am working with some purchased source code which
>contains types which are structures which themselves
>contain structures and even more structures.
>Each field in the structure is itself its own datatype.


>Is there a tool I can use that I can wrap a structure
>and have it dump out the composition based on basic
>types?


Standard C makes no attempt to be "reflective" -- no attempt, that
is, to allow you to use your program to examine your program.
And anything having to do with compiler options is going to be
compiler specific, and this newsgroup only talks about standard (portable) C.


It -is- within the rhelm of possibility to use standard C to write
a program whose input is the program you want analyzed. That analysis
program would have to be a close approximation of being a compiler,
as it would have to know about conditional compilation and about
all the ways C types can be built up, it would have to know about
default typing, and it would have to know about scoping rules.
I don't think I could name a suitable program, but it would not surprise
me if one existed.
--
I am spammed, therefore I am.
 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      10-14-2005

"bsd_mike" <> wrote in message
news: oups.com...
>
> I am working with some purchased source code which
> contains types which are structures which themselves
> contain structures and even more structures.
> Each field in the structure is itself its own datatype.
>
> Is there a tool I can use that I can wrap a structure
> and have it dump out the composition based on basic
> types?


Perhaps (have you asked Google?). But creating such a
tool would imo be a good exercise. And by the time
you're done, you'd be well on the way to writing a
compiler.

-Mike


 
Reply With Quote
 
Marc Boyer
Guest
Posts: n/a
 
      10-14-2005
Le 13-10-2005, bsd_mike <> a écrit*:
> I am working with some purchased source code which
> contains types which are structures which themselves
> contain structures and even more structures.
> Each field in the structure is itself its own datatype.
>
> Is there a tool I can use that I can wrap a structure
> and have it dump out the composition based on basic
> types?


For which purpose ?
Any reasonnable debuger will show you the composition
of variables of a given type. It can help you to
understand a non/bad documented code.

Marc Boyer
 
Reply With Quote
 
Michael Wojcik
Guest
Posts: n/a
 
      10-14-2005

In article < .com>, "bsd_mike" <> writes:
>
> I am working with some purchased source code which
> contains types which are structures which themselves
> contain structures and even more structures.
> Each field in the structure is itself its own datatype.
>
> Is there a tool I can use that I can wrap a structure
> and have it dump out the composition based on basic
> types?


Not as part of the standard language, but you may want to try Doxygen,
a free documentation generator (similar to javadoc but for a variety
of languages). It has an "automatic" mode where it generates HTML
documentation from unannotated source; you can use the result to
examine a structure type or variable and drill down through its com-
ponent types.

http://www.doxygen.org

--
Michael Wojcik

The way things were, were the way things were, and they stayed that way
because they had always been that way. -- Jon Osborne
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc compiler options for K&R C code Options Utkado C Programming 2 12-18-2008 01:50 PM
why doesn't this "belongs_to" line of code, using options override,not work??? (need help using belongs_to with options) Greg Hauptmann Ruby 1 10-30-2008 10:44 PM
OptionParser - no short options or incomplete options Bryan Richardson Ruby 6 02-25-2008 03:22 AM
Performance issue in multi-level Oracle Object/thin JDBC Options Options jacksu Java 0 10-09-2007 08:21 PM
good compile options for g++ options to enforce good coding Cliff Martin C++ 1 01-31-2007 02:03 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57