if i use it onCode:#define SET_QR(X) (X|0x8000)
[CODE]SET_QR(i);[CODE]
i get:
Code:client.c:37: warning: statement with no effect
if i use it onCode:#define SET_QR(X) (X|0x8000)
[CODE]SET_QR(i);[CODE]
i get:
Code:client.c:37: warning: statement with no effect
The SET_QR macro shouldn't be an expression by itself. The end result of the macro is just a number, say 0xF800; to have an effect on the program, it needs to be part of a larger calculation. Numbers by themselves are not processing instructions.
i solved it
very silly problem.Code:#define SET_QR(X) (X=X|0x8000)
now... what does this declaration mean?
does this declares a bit ?Code:char a:1;
It declares a bit field. You might think of an integer on your system like a 4-32-bit field, for instance.
And you should under general circumstances use unsigned values in bit fields to avoid issues with signedness, where a negative number has a different bit pattern than you expect and get incorrect results from your bitwise operations. You also don't waste half the range supporting a sign that you won't use in calculation.
Last edited by whiteflags; 05-11-2007 at 08:05 PM.