This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: I'm sorry, but this is unacceptable (union members and ctors)




mark-28 wrote:
> 
>> Mark Mielke wrote "Why not This?":
>> >     class Rectangle {
>> >         Vector2d position;
>> >         Vector2d size;
>> >     };
>> > ... rectangle.position.x = ... ...
> 
> On Thu, Jun 28, 2007 at 03:00:07AM -0700, michael.a wrote:
>> My foremost personal requirement is that no code need change outside the
>> object definition files. And besides it is ridiculous to jump through two
>> hoops, when one would suffice.
>> ...
>> Have you read the thread? (not that you should -- but before making such
>> an
>> assessment)
> 
> You find it unacceptable that GCC implements the C++ spec, and fails to
> compile
> your software that was not implemented according to the C++ spec.
> 
> You find it unacceptable that you would need to change your code to
> match the spec, but would instead rather modify GCC and have your patch
> to GCC rushed out so that you can release your product on Linux.
> 
> You find it unacceptable that union members not be allowed to contain
> struct with constructors, because you believe that the practice is safe,
> and valid, because the designer knows best. You believe the spec should
> be changed and that Microsoft has lead the way in this regard.
> 
> Do I have this right?
> 
> Is there a reason that this discovery did not occur until late in your
> development cycle? It seems to me that the first mistake on your part
> was not testing on Linux/GCC when writing the original code, if you
> knew that this was an intended port.
> 
> Cheers,
> mark
> 
> P.S. I apologize for getting confused on my last post. I was tired + ill
>      and stupidly posting after midnight. Perhaps this one will be more
> relevant
>      and effective?
> 
> 

This is a correct sumization in effect. Though I would differ that it was
not so much my mistake to not conform to gcc from the offset. I'm planning
on releasing binaries, so its not a major hickup to hack gcc. It would be
nice to see an official solution evolve in due course however. I see no
reason why c++ should be neutered to this effect. I would sight laziness on
behalf of the gcc development effort (with the effort present excuse of
adhering to spec)

C++ should've removed unions from the spec altogether if they won't support
the fundamental basis of the need for an object oriented C language (and
there is no reason why they can not be supported -- albeit, with some
caveats which really any even remotely competent person could predict)

There really is no call for such platitudes, you've simply chosen the losing
side of the argument if you choose to believe C++ will never accomodate
functional objects to be unioned. 

This is all I have to say. I will let everyone know how construction/etc is
handled by the compiler as soon as the porting process permits (a testbed
application would not likely reflect real world scenarios so easily I
suspect)

sincerely,

michael

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


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