Re: bitops and endianness

Jes Degn Soerensen (jds@kom.auc.dk)
06 Feb 1998 12:29:40 +0100


Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be> writes:

> On Wed, 4 Feb 1998, Benjamin C.R. LaHaise wrote:
> > Hmmm? But bitops are valid on a char - they're defined to work in little
> > endian fashion across all platforms, hence there shouldn't be a problem.
> > Besides, if the caller specifies an out-of-range bit offset, memory will
> > get overwritten, and there's nothing that can be done about it.
>
> I checked with some people and they disagree: bitops are defined to work in the
> native order of the CPU.
>
> This means that bitops on anything less than a long (valid on 32 and 64 bit
> CPUs) are invalid.

Correct, we created a special version of the bitops for ext2 for this
reason.

Jes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu