For a pretty-printer that I'm writing, I would like to know the alignment or the type which is used in a container. Unfortunately using alignof()
or any similar "standard" operator doesn't work (https://sourceware.org/bugzilla/show_bug.cgi?id=17095). Using "typical" macro tricks that work directly in source code also doesn't work:
p ((char *)(&((struct { char c; double _h; } *)0)->_h) - (char *)0)
A syntax error in expression, near `{ char c; double _h; } *)0)->_h) - (char *)0)'.
Is that possible at all, or maybe the only way is to have that supported by GDB internally?