Better handling of integer wraparound in the kernel
Better handling of integer wraparound in the kernel
Posted Jan 28, 2024 18:00 UTC (Sun) by Wol (subscriber, #4433)In reply to: Better handling of integer wraparound in the kernel by khim
Parent article: Better handling of integer wraparound in the kernel
> No, you couldn't. Even if limit sounds sane today it would be, most definitely, be too small tomorrow.
Stop  being an arrogant idiot!
Okay, I can't think of an example, and I guess you haven't even bothered to look, but I'm sure other people will be able to find examples where a certain positive big number indicates an error. Certainly I'm sure there are examples where the mere EXISTENCE of a negative value is an error (in other words 0 is an absolute lower bound).
(Actually, as a chemist, I've just thought of a whole bunch of examples. s is either 1 or 2 (can be empty aka 0). Likewise, p is 1 to 6. d is 1 to 10. f is 1 to 14. ANY OTHER VALUE IS AN ERROR.) To have the compiler make sure I can't screw up would be a wise choice.
And please, WHY ON EARTH would you want to store an entry about a company into a genealogical database? While it's possible it'll change (extremely unlikely), any value for age outside 0 - 126 is pretty much impossible. In fact, surely you DO want to limit that value, precisely in order to trigger an error if someone is stupid enough to try to enter a judicial person into the database!
Cheers,
Wol
      Posted Jan 28, 2024 22:23 UTC (Sun)
                               by corbet (editor, #1)
                              [Link] 
       
     
    
      Ok let's stop this here please. Seriously.
      
          Enough
      
           