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,144
  • 5
  • 47
  • 65
liv2hak
  • 13,641
  • 48
  • 139
  • 250

0 Answers0