On Sat, Jan 28, 2012 at 01:59:31PM +0000, Alexander Nasonov wrote: > > IIRC something in the standard requires the result to be a compile time > > constant > > You're right: "... which expands to an integer constant expression that > has type size_t, the value of which is the offset in bytes ...". > > > I suspect uses like the above were not thought of when the standard > > was written! > > If they allowed sizeof to be a run-time value for VLAs they would > probably allowed such use of offsetof if they thought of it ...
That sounds like a formal defect for which someone could file a formal defect report if it didn't require jumping through sixteen hoops while whistling God Save the Queen backwards. Is comp.std.c still alive? Bringing it up there would be a good start. -- David A. Holland dholl...@netbsd.org