1

I recently came across a code where

                uint32_t index = -1;

Is this safe to use the above.Assume that the code will have to be compiled across multiple Linux platforms and distributions.Or is it recommended to use a signed value? if I compare it against -1 somewhere in the program is it likely to compare -1 with 0xffffffff and throw an error or manifest some other strange behaviour.

Steve Fallows
  • 6,274
  • 5
  • 47
  • 67
liv2hak
  • 14,472
  • 53
  • 157
  • 270

0 Answers0