dotgnu-general
[Top][All Lists]
Advanced

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

Re: [DotGNU]a segfault on anonymous bit field


From: Gopal V
Subject: Re: [DotGNU]a segfault on anonymous bit field
Date: Thu, 29 Aug 2002 17:01:41 +0530
User-agent: Mutt/1.2.5i

If memory serves me right, Rhys Weatherley wrote:
> Whoops.  Your fix was fine, but I decided to do it another
> way.  There's no need to add the "BitFieldAttribute" instance
> to the class for anonymous bit fields, as there is no way
> to reference them by name.  I avoid the SEGV by not calling
> the function in the first place.

I had tried that, but the code might have a sligt issue there ...

struct xyz
{
        char :2;
        char x:2;
        char y:2;
        char z:2;
};

would be incorrect if I omitted to add the first anonymous bitfield ?
(my fix adds a bitfield named "" to provide the necessary padding)

ie the above one is not the same as 

struct xyz
{
//      char :2;
        char x:2;
        char y:2;
        char z:2;
};


> This behaviour is consistent with gcc.  

k, I should really check stuff more thoroughly ...

Gopal
-- 
The difference between insanity and genius is measured by success


reply via email to

[Prev in Thread] Current Thread [Next in Thread]