Re: [PATCH] ubi: kill homegrown endian macros

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

 



It's not the compiler who decides -- struct layout is
dictated by the ABI you're compiling for.

This is true in the case of externally-visible stuff. I think the
compiler is permitted to violate the ABI for purely unit-internal things
if it makes sense though, isn't it?

Sure.  It isn't "violating the ABI" in that case though,
to be perfectly clear.

Besides, in the case of the Linux kernel the ABI in question could be
one of many. It could even be a new one which was added a couple of
weeks ago, and which I had no _chance_ of considering.

Of course.

The rule stands -- empirical testing of what the compiler will do isn't
usually the right answer.

It is *never* the right answer.  You should always write
your code so that it will do the right thing no matter
what the compiler decides to do to it.


Segher

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux