C is Brittle D is Plastic

Walter Bright newshound2 at digitalmars.com
Tue Apr 7 20:24:04 UTC 2026


```
if (foo())
     T* p = (T*)malloc(...);
...dum dee dum dee dum...
if (foo())
{
     *p = 3;
     free(p);
}
```
If the static analyzer cannot determine what foo() returns, it cannot determine 
if the code is bad or not. It's the halting problem.

I've seen the equivalent of this in the wild. It's bad style, but it exists.


More information about the Digitalmars-d mailing list