home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,762 of 243,242   
   highcrew to Kaz Kylheku   
   Re: On Undefined Behavior   
   04 Jan 26 14:38:00   
   
   From: high.crew3868@fastmail.com   
      
   On 1/2/26 11:56 PM, Kaz Kylheku wrote:   
   > You literally cannot write a test case which tests for the "return 0",   
   > such that the test case has well-defined behavior.   
   >   
   > All well-defined test cases can only test for 1 being returned.   
   >   
   > And that is satisfied by machine code which unconditionally returns 1.   
      
   I appreciate the nuance, or at least think I understand what you are   
   saying here. A test that aims at spotting UB is necessarily using   
   UB-tainted code, so it might even pass against all odds.   
      
   Then it looks to me like this is one of those situations where practice   
   beats theory. Unit testing, sanitizers, fuzzers... these tools will   
   reveal the defect with a very high likelihood.   
      
   Not differently from halting problem: sure, it is theoretically   
   impossible to understand if a program will terminate, but in practical   
   terms, if you expect it to take less than 1 second and it takes more   
   than 10, you area already hitting ^C and conjecturing that something   
   went horribly wrong :D   
      
   --   
   High Crew   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca