[Cobolforgcc-devel] Re: %union
Status: Pre-Alpha
Brought to you by:
timjosling
|
From: Keisuke N. <kx...@po...> - 2001-06-05 20:39:38
|
At Wed, 06 Jun 2001 06:11:58 +1000, Tim Josling wrote: > > The approach I took is to define seperate structures and do > casts. At first, I used to cast on every access, which became > tedious very quickly (you still see a fair bit of this code lying > around). So now I cast into a variable which is of the right type > and use that variable. This would not cause any runtime slowdown > as the cast is opimized away. This also gives me a good > opportunity to put in an assert or a type check to improve the > integrity of the program. This is the closest to type safeness I > have been able to get. Okay, I think I understand you, though I now prefer accessor macros because of their simplicity, forgetting about type safeness. > 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 |