Comment Once upon a time ... (Score 1) 292
I woked as a texg writer at a large company that I won't name. The group I was in developed test tools for internal use company use, nothing that got shipped to clients. They had 600,000-odd lines of C code in the tool set.
One day I did some grepping through it. I cannot recall everything I checked, but all my results were awful. Things I do recall:
A couple of thousand uses of functions that could fail like fopen() or malloc() without the idiom (fp = fopen(...)) != NULL or the same with ==. I checked a few manually, and none had any other error checks.
Only about 5% of switch() statements had a default case.
There were under 10 uses of the assert() macro in the whole set, all in one guy's code.