CRAY bitfield support in protocol headers: does anyone care?

Barton C Massey bart at cs.pdx.edu
Wed Feb 28 23:52:02 PST 2007


In message <45E609B3.8010705 at us.ibm.com> you wrote:
> Juliusz Chroboczek wrote:
> >> It's not likely that people here don't complain about this here if
> >> noone here has access to such an architecture.
> > 
> > Methinks it's a complier issue, not an architecture issue.  You'd hope
> > that C compilers would have learnt to synthesise masks out of sub-word
> > struct fields by now.
> 
> The CRAY compilers were perfectly within the C spec.  The C spec says,
> for example, that "short" must be *at least* 16-bits.  Last time I
> checked, 64-bits was at least 16-bits.  It just happens that there's no
> way, and there doesn't have to be in C89, to specify exactly 16-bits or
> exactly 32-bits.  So, you have to resort to bit-field nonsense.

I think Juliusz's point, with which I heartily agree, is
that while de jure this is a legal C implementation, de
facto it's kind of obnoxious for portability.  Thus, you
would hope that any decent modern CRAY (why are we all
all-capsing Cray's name?) C compiler would have a "do the
portable thing" switch.

    Bart



More information about the xorg mailing list