Thread: Variable Identification

  1. #1
    Registered User
    Join Date
    Jan 2012
    Location
    Las Vegas, NV
    Posts
    5

    Variable Identification

    Hello, thank you for taking a look. I am looking for a nice and easy way to "spit-out" all variables within a specific source file. I can use a nice text editor to see the variables in a source file by color, I am looking for maybe a simple tool that will produce a list of all variables within a source file, maybe a compiler diagnostic output or a debugging tool that will identify what I'm looking for.

    Any help is appreciated.

    Thank you.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    On Linux and the like, there is a tool called cproto (you can probably find a port to Windows too). It's mainly meant to generate function prototypes and extern declarations, to be put in a header file. It will also work with static and inline functions. Unfortunately, I think it only works with file-scope identifiers, i.e. functions and global variables, so if you want local variables too, you're out of luck.

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    546
    Gimpel PC-LINT has an option to output just about everything about a c file including all symbols including locals. but its not a free program.

  4. #4
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Check Splint, it's a free lint tool. I've never used it though, so I don't know if it supports that feature.

  5. #5
    Registered User
    Join Date
    Jan 2012
    Location
    Las Vegas, NV
    Posts
    5
    All great information. Thank you for your help!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Fingerprint identification project
    By deeptikoshy in forum C Programming
    Replies: 1
    Last Post: 04-12-2012, 06:03 AM
  2. Process Identification
    By pjdriverdude in forum C Programming
    Replies: 4
    Last Post: 09-11-2009, 10:33 AM
  3. runtime type identification
    By nads20489 in forum C Programming
    Replies: 6
    Last Post: 07-22-2009, 11:48 AM
  4. speech identification
    By subdene in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 01-08-2005, 12:56 PM
  5. local IP identification via C internal functions
    By andrew in forum C Programming
    Replies: 0
    Last Post: 12-19-2001, 06:46 AM