From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Tromey To: Keith Seitz Cc: Willem Hajenius , Subject: Re: Bugs/Features Date: Thu, 13 Sep 2001 16:53:00 -0000 Message-id: <87y9ni7hz2.fsf@creche.redhat.com> References: X-SW-Source: 2001-q3/msg00257.html Keith> Unfortunately, as you've discovered, the "dismissable" warnings Keith> are renewed every time Insight is run. I think there's a PR for this. >> struct rec >> { >> char c[5]; >> }; >> >> f = (foo*) malloc (10); Keith> (I must say -- this is an evil coding practice! Why hide the Keith> true type of the variable? If you want to make it opaque, just Keith> make it opaque and cast it when needed. Maybe this is just a Keith> bad example??) Actually this is the old C `struct hack' idiom. In traditional C you were allowed to declare the last field in a struct as an array; then you could allocate additional space and it would act like a variable-sized array, without the overhead of an additional pointer in the struct. It isn't very common, but it isn't uncommon either. Tom