开发者

code porting from 32bit to 64bit

I am trying to port 32bit code to 64bit linux machine. Are there any comp开发者_如何学编程iler 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,


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.


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...)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜