Re:Re: [gcc plugin] get member offset in struct just like offsetof

2018-02-07 Thread dotpy
Hi Eric, Thank you very much. Your advise is exact right. :) The function bit_position and byte_position is what I want to implement offsetof. Regards At 2018-02-07 00:58:17, "Eric Botcazou" wrote: >> I am writing a gcc plugin for parsing the structure fields. But I have the >> problem how to

[gcc plugin] get member offset in struct just like offsetof

2018-02-06 Thread dotpy
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 ov