TL;DR : I need tools to locate problematic code in a 32 to 64 bits C++ Linux migration (tools can be under Linux or Widows).
So here it is, I have a huge c++ application (we are talking more that 8M lines of code) which I wish to port from a 32 bits platform to a 64 bits one (on linux). The reason of porting the code is not questionable, my task is to do so. The app is totally functional on 32 bit but the code can be really old in some part and is clearly not coded with recent standards and good practices. In order to succeed I need to locate all code fragments which will be problematic when compiled in 64bits without spotting too much false positive since we are talking millions on lines and i don't have resources to refactor all code to make it clean and pretty. So finally my question is what tools can help me in this task?
I considered PVS-Studio but it seems designed for Windows app. I also considered using compilers messages like Gcc and Clang warning but there is way too much false positive since in the 32 bits case there is already a lot of them. I also considered static analyzing tools like Cppchack, Klowork, Gimpel Pc-Lint and FlexeLint or "Parasoft C++ test" but i don't really know those tools and if they can really help me.
In short, the patterns I need to locate are (ask me if you need more detail) :
- problematic use of types with different size in 32 and 64 bits
- overflows induce by the migration
- problematic magic values
- memory alignment change in structure, union and so
- bad use of format specifier (like in printf(“%u”, val); if val is a long)
- problematic implicit cast
- methods and functions that no longer match (virtual and overloaded method)
The 4 key points are that :
- I need to find all problems induced by the migration or to know what types of problems i missed if i can't find them.
- I need to have few false positive or a way to quickly eliminate them (need automation)
- The solution have to be industrial (i.e scriptable or automatic). It's a huge code base, by hand work is not possible.
- The solution can be one tool or a set of tools, free or not, Linux or Windows.
It would be a plus if the tool comes with a nice and clear documentation.
If you ever experienced this kind of problem, thank you for any advice you can give me.