This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bugs/Features


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]