Building the whole Debian archive with GCC 4.1: a summary
Posted Mar 28, 2006 15:00 UTC (Tue) by
foo-bar (guest, #22971)
In reply to:
Building the whole Debian archive with GCC 4.1: a summary by butlerm
Parent article:
Building the whole Debian archive with GCC 4.1: a summary
For example, the ISO C++ people, in their infinite wisdom, decided that anything resembling an offsetof() was to be illegal in C++ in all circumstances, breaking both C compatibility and a *large* body of C++ code. Granted offsetof() is not particularly well defined in cases where there are multiple base classes, but since when is a "C" style language the arbiter of correct programming practice?
GCC does have various extensions to ISO standard.
These extensions are well documented and were added intentionally.
Apparently offsetof(non-POD) didn't deserve to become an extension and hence
was removed.
All I can say is it is unusually irritating for GCC to disallow what used to be perfectly legal idiom with well defined semantics and then not provide some sort of backward compatibility option or other work around.
Anything that is not spelled in the ISO standard and is not defined as GCC extension is illegal by the definition. The fact that it worked doesn't make it a "legal idiom". Writing such code is a mistake that the author is solely responsible for, and nobody has any moral obligation to provide any work arounds not even talking about backward compatibility which implies allowing illegal idioms in the future.
IMHO :-)
(
Log in to post comments)