tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: proposal: some pointer and arithmetic utilities

Alan Barrett <> wrote:
 |I don't really see the point of offsetin -- if you have a struct 
 |that ends with an array of 1 element, but you want to allocate 
 |enough space for the struct plus an array of >1 elements, then why 
 |not just do the arithmetic without a macro, and if you do need a 
 |macro, then why not give it a name that sounds more like "sizeof"?

Hm - my reading of C99 is that using array[1] as a base of a
variable-sized array has become undefined behaviour (Annex J, 2.,
"Addition or subtraction of a pointer [.] produces a result that
does not point into, or just beyond, the same array object").
Since todays compilers over-optimize so aggressively i indeed
became so frightened that i only use the [] notation, i think it's
called "flexible array" or something.


Home | Main Index | Thread Index | Old Index