@mrprogguy said:
You do have a lint available, don't you?
Yes, and there-in lies part of the rub. The app itself is written in Oracle's Pro*C which gets transmogrified into a real C file and then compiled. Running lint on the transmogrified file catches all the garbage that Oracle puts in there, but not this thing.
In fact, I ran lint on the example above and got this:
lint: "tdwtf.c", line 7: warning 825: "i" may be used before set
lint: "tdwtf.c", line 3: warning 828: argument "argc" unused in function "main"
lint: "tdwtf.c", line 3: warning 828: argument "argv" unused in function "main"
==============
name declared but never used or defined
snprintf stdio.h(593)
__bufendtab stdio.h(647)
vsnprintf stdio.h(594)
__iob stdio.h(172)
function returns value which is always ignored
sprintf
Now, admittedly, I could be doing it wrong, but looks like it only caught the unused variables, not the really bad sprintf error.
With that said, I haven't completely ruled out following up on bstorer's suggestion...