Corin Anderson (magellanic) wrote,
Corin Anderson

Type safety

bools should not automatically be promoted into ints in C++. I use a bool with the express purpose that it *is* different from an int, mainly to catch compiler errors. But, if the compiler silently typecasts bools to ints, but I just happen to put "true" values at index 0 instead of index 1, then very bad things start happening. Yeesh.

Okay, stupid bug #1 found at the new job. Woo.
  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.