Firstly, the input of your OR is FFFFFFFF
in hex notation, which means that in binary (bitwise) terms it is 11111111111111111111111111111111
. I.e. it is a lot more 1
s than you quoted (32 bits, to be exact).
Secondly, the bitwise OR in question should indeed return 1111111...1
in binary notation. And that is exactly what it returns. But when you print the result in hex notation, you get FFFFFFFF
. You explicitly requested hex notation by using x
format specifier in printf
.
Unfortunately, printf
has no format specifier for producing binary notation. However, converting hex to binary is a trivial task, since it is a straightforward replacement of each hex digit with four binary digits. F
stands for 1111
, so as you can see, in bitwise terms your OR did indeed produce 11111111111111111111111111111111
, as it should.