I\'d like to see all the places in my code (C++) which disregard return value of a function. How can I do it - with gcc or static code analysis tool?
Bad code exampl
A static analyzer will be your best bet here. We use Coverity here, but there are free tools available that you can use as well.
If you need a quick-and-dirty solution and you have a Linux-style shell handy, you can try something like:
grep -rn "function_name" * | grep -v "="
That will find every line that references the specified function but does not contain an "=". You can get a lot of false positives (and potentially some false negatives) but if you don't have a static analyzer it's a decent place to start.