R
Rahul
Hi Everyone,
I have a program unit which does >> and << of an integer which is of
4 bytes length. The logic of shifting and action based on the result,
assumes that the system is big-endian.
Accordingly, if i need the program to work fine in a little-endian
system. I understand that the code needs to be changed. ( I couldn't
find any statement in C90 about endianness, hence i'm assuming that c
programs are not portable if the endianness of the system changes)
I wanted to know if the above holds true for bitwise and (&) and
bitwise or (|). I think, the system should take care of the
operation a&b or a|b irrespective of the endianness of the system.
Please provide your comments.
Thanks in advance!!!
I have a program unit which does >> and << of an integer which is of
4 bytes length. The logic of shifting and action based on the result,
assumes that the system is big-endian.
Accordingly, if i need the program to work fine in a little-endian
system. I understand that the code needs to be changed. ( I couldn't
find any statement in C90 about endianness, hence i'm assuming that c
programs are not portable if the endianness of the system changes)
I wanted to know if the above holds true for bitwise and (&) and
bitwise or (|). I think, the system should take care of the
operation a&b or a|b irrespective of the endianness of the system.
Please provide your comments.
Thanks in advance!!!