Alfons Hoogervorst ([info]alfons) wrote,
@ 2004-03-14 13:16:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Bits
Saw the following thing in sylpheed-claws source code:

  guint32 low, high;
  .
  .
  .
  sscanf(*range, "%u:%u", &low, &high);

In 99% of the cases, constraining the bit length of a type is not necessary at all. The 1% case is when interfacing with system layers, but even in that case you need to be aware that C and the C standard library don't assume anything about the bit length of a type. (guint32 happens to be an unsigned int on 32-bit i386 architecture: this is a bug waiting to strike back hard with other archs around the corner.)



Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…