How can I tell whether my GCC is compiling 64bit b

2020-07-03 03:24发布

问题:

is there any way to know whether GCC is compiling 32 or 64bit code by default?

my GCC version is 4.1.2. my os kernel version is x86_64.

thanks.

回答1:

Type gcc -v. Amongst other things, it will tell you the target platform. For instance, I get:

Target: x86_64-redhat-linux


回答2:

As @Oli said, the configuration should tell you, but it's possible to screw with that after the fact.

For belt and braces, simply compile something, and then use file to examine the output file.