Re: [Cobolforgcc-devel] Re: %union
Status: Pre-Alpha
Brought to you by:
timjosling
From: Tim J. <te...@me...> - 2001-06-06 11:33:24
|
Keisuke, With accessor macros, you have to look at the macro to see what is the underlying field. For example in gcc, TREE_USED(x) is common.used_flag. This is particularly a problem if the same field is used for multiple things, as it is in gcc (see tree.h). The debugger does not know about accessor macros AFAIK so in the debugger you have to know the real field names. static_flag has six different accessor macros. Actually I am not really that against accessor macros, I used them in treelang (sample front end) but mainly because I wanted to make it as consistent with gcc as possible. The other thing is that having one giant union means that when you do a p *x in gdb, the output goes for pages. On the other hand just having cast into a single struct * makes it more manageable. I am not against accessor macros if you want to use them in code you write. It would not be a problem to define a %union I don't think. Maybe the existing code would have to have casts added though. I have a clean compile policy. Tim Josling Keisuke Nishida wrote: > ... > > > I don't like accessor macros really because you have to keep > > looking up what actual fields they are accessing. > > Could you explain what you mean here? > > Thanks, > Keisuke Nishida |