dhh1128 / intent

the intent formal language
https://intentlang.org
2 stars 1 forks source link

make sure warnings or errors explain the risk and how to remediate #64

Open dhh1128 opened 9 years ago

dhh1128 commented 9 years ago

instead of just saying "signed/unsigned comparison", we should say something like "Code compares a signed and an unsigned integer using the > operator. This can cause problems because the two values don't have the same range, and overflow/underflow can yield unexpected results. For example, -3 > 2 might yield true if -3 is coerced to unsigned. To fix this, prove that both numbers have a common, safe range for the comparison by marking the range of one or both of them."

dhh1128 commented 9 years ago

Consider how this warning has been redesigned so it asks a question. If the user says they're going to a place where risk is high, the severity gets jacked up. If not, no warning is given, because risk is very low, and the designers wanted to prevent habituation. Source: https://www.usenix.org/legacy/event/sec09/tech/full_papers/sec09_browser.pdf

screen shot 2014-09-17 at 6 54 24 pm