Hi experts,


I am writing a gcc plugin for parsing the structure fields. But I have the 
problem how to get the offset of each field in the struct? Just like the 
offsetof macro in gcc.

I see DECL_FIELD_OFFSET in tree.h, but the result seems not right.

My test program could be found in stack overflow:

https://stackoverflow.com/questions/48582971/gcc-plugin-to-implement-offsetof




Could someone explain what is DECL_FIELD_OFFSET used for, and how to implement 
offsetof?




Thanks

Reply via email to