I'd shorten this to:

```
if (tf && tf->parameters && tf->parameters->dim != paramcount)
    warning(s->loc, "Ddoc: parameter count mismatch"); 
```