I am trying to port 32bit code to 64bit linux machine. Are there any compiler flags for 64bit posrting warning on Linux.
There are +w2 -m64 flags for SUN. Could anyone give me information for flags similar to this one?
Thank you in advance,
I am trying to port 32bit code to 64bit linux machine. Are there any compiler flags for 64bit posrting warning on Linux.
There are +w2 -m64 flags for SUN. Could anyone give me information for flags similar to this one?
Thank you in advance,
hope that helps 20 issues of porting C++ code on the 64-bit platform
This is not exactly the answer you are looking for, but you could try replace as many int
as possible with int32_t in a first porting phase.
Also look at the other answer.
(No I can not comment, seems I have too little rep...)
Try gcc -Wall -Wconversion -Wpointer-arith -Wtype-limits -Wcast-qual
Actually, read the gcc man page, there are a ton of warnings, and some of them may be helpful only if your code doesn't produce a flood of them for things you know aren't actually a problem. -Wall, -pedantic, and -Wextra are meta-flags that turn on a bunch of warnings. -Wall includes many of the important ones that will occur when you try a 64bit build of code that does bad things.
-Werror
(turn warnings into errors) might be useful to avoid having to make clean
after fixing some but not all errors.