On 13 January 2012 09:30, Shakthi Kannan wrote: > Hi, > > I would like to know if there are any flags or options that can be > passed to gcc to retrieve the members of a struct {}? What do you mean by retrieve? Get a list of member names? Names and types? Offsets? At runtime? At compile time? (I think the answer's no, in any case.) > I want to be > able to compute a CRC checksum for each member of a structure in a .c > or .h file. Again, I'm not sure what you mean. Do you mean compute a checksum of the values, or the layout, or something else? At runtime, or before the program runs? Or after? > Or, if there is any other way to do it, please do let me know. You can retrieve information on object layout from DWARF debugging info.