title: Is it safe to use -1 to set all bits to true?
body: <p>I've seen this pattern used a lot in C &amp; C++.</p>
  
  <pre><code>unsigned int flags = -1;  // all bits are true
  </code></pre>
  
  <p>Is this a good portable way to accomplish this?  Or is using <code>0xffffffff</code> or <code>~0</code> better?</p>