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,920 of 243,242    |
|    Lawrence =?iso-8859-13?q?D=FFOlivei to Andrey Tarasevich    |
|    Re: NULL dereference in embedded [was: O    |
|    08 Jan 26 23:56:16    |
      From: ldo@nz.invalid              On Wed, 7 Jan 2026 20:48:03 -0800, Andrey Tarasevich wrote:              > When it comes to invalid (or missing, in C++) `return` statements,       > GCC tends to adhere to a "punitive" approach in optimized code - it       > injects instructions to deliberately cause a crash/segfault in such       > cases.       >       > Clang on the other hand tends to stick to the uniform approach based       > on the "UB cannot happen" methodology, i.e. your code sample would       > be translated under "p is never null" assumption, and the function       > will fold into a simple unconditional `return 0`.              Which one is more likely to lead to unexpected, hard-to-debug results?              --- 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