When is byte_order change ignored?

I am getting a warning for the function argument that typecasting here is changing the byte_order from bigendian int to int. so i change it to bigendian int. but doing this is ignored.

function_call_name((int*)&argument1, argument2));

function_call_name((int* __attribute__((bigendian))) & argument1, argument2);

Tried to find a solution for this https://software.intel.com/en-us/node/628908

But it doesn't work out.

May I get help? :)

Also how to find out if byte_order is working. I mean some #ifdef directive?

+3


source to share


1 answer


If these (non-standard) qualifiers are something like a qualifier const

like:

const int *a;                 // a is a pointer to const int
int const *b;                 // b is a pointer to int const (same as a)
int * const c = (int[42]){0}; // c is a const pointer to int (DIFFERENT!)

      

Differences from them can be observed by trying to change them:



a = (int const[]){0}; // This is allowed
a[0] = 42;            // This is NOT allowed
c = NULL;             // This is NOT allowed
c[0] = 42;            // This is allowed

      


I think you probably meant to write int __attribute__((bigendian)) *

, that is, put an attribute in front of an asterisk to denote that you want a pointer to a big endian int

, because after that it will denote a large pointer to end int

...

0


source







All Articles