Re: Bit field issues in Solaris 2.8

From: Callum Gibson (
Date: Fri Aug 08 2003 - 01:37:26 BST

  • Next message: Steve Harris: "Re: Bit field issues in Solaris 2.8"
    On Thu, Aug 07, 2003 at 05:01:13PM +0000, Steve Harris wrote:
    }I am now running the 3.38beta and it behaves the same way. I have
    }found it to be a bitfield structure display issue. The bit values are
    }actually correct in the program. they just don't show up right through
    As another datapoint, bitfields have always worked fine for our use of them
    on Solaris 2.6 (up to v3.37) and FreeBSD 4.8 (3.38b1).
    However if I do something like this with 3.38b1:
    typedef struct {
        unsigned int day:5;
        unsigned int month:4;
        unsigned int year:12;
    } Date;
    Date x; = 8;
    x.month = 8;
    x.year = 2003;
    printf("%d/%d/%d\n",, x.month, x.year);
    On FreeBSD display/edit works fine. On Solaris, it displays zeroes and
    just gobbles up all values when edited. However, the edited values are
    stored because the printf shows correctly what was entered. This looks like
    a problem that was introduced in 3.38b1 (our previous Solaris version was
    3.37) on Solaris (2.6 - the original poster was on 2.8). Perhaps an endian
    Callum Gibson                            
    Global Markets IT, Deutsche Bank, Australia       61 2 9258 1620
    ### The opinions in this message are mine and not Deutsche's ###

    This archive was generated by hypermail 2.1.4 : Fri Aug 08 2003 - 11:35:36 BST