I am inheriting a fairly large code base which unfortunately exhibits a lot of "bad habits". One of my largest personal pet peeves is declaring several variables in one expression like this:
int x, y, z;
personally, I prefer:
int x;
int y;
int z;
this allows me to easily adjust the types individually, and avoids issues with pointer types like this:
int *x, y, z; // whoops I meant to make y and z pointers too!
Also, I'd love to detect when a type whose size is bigger than sizeof(void*)
is being passed by value.
There are other "style" issues I'd like to detect and correct as well, but these are the most annoying IMO. What are the best tools for this?