Robert Dewar wrote:
> 
> 
> I think there is a lot of merit in
> 
> a) C++ programmers writing in C++ and not idiosyncratic dialects
> b) C++ compilers implementing C++ and not idiosyncratic dialects
> 
> Certainly if you are interested in porting code, as seems to be the
> case here, following a) is a good idea.
> 
> []
> 
> There are hundreds of possible extensions to any language that make
> technical sense, but that still is not a reason for violating b) above.
> The only time that it is reasonable to extend is when there are clear
> signals from the standards committee that it is likely that a feature
> will be added, in which case there may be an argument for adding the
> feature "prematurely".
> 
> 

Extensions are harmless as long as authors clearly understand the pitfalls
they offer and mandatory compile options are required to enact them. The
line should be drawn somewhere naturally, granted the philosophy of a
particular implementation. GCC being the premier compiler for Linux however
definitely should not have such a staunch attitude regarding extensions. The
EGCS episode should be testament enough in that light.

The extension I have proposed here would fall along the lines of the "for
loop scope" extension, which I would regard as a class A extension, which
GCC should definitely accommodate in some simple and definable fashion.
There are many cases where every member in a union with a ctor could be
initialized, and deinitialized, there is therefore no reason why a
programmer should not be permitted to define such a union. Of course there
are many cases where this would cause undesirable behavior, but such
behavior does not have to be unexpected as well. If it is just defined what
will happen, then it is up to the programmer to know the definition after
enabling the extension flag at compile time. Many malformed unions would be
possible, but that would be up to the programmer to avoid.


-- 
View this message in context: 
http://www.nabble.com/I%27m-sorry%2C-but-this-is-unacceptable-%28union-members-and-ctors%29-tf3930964.html#a11155951
Sent from the gcc - Dev mailing list archive at Nabble.com.

Reply via email to