gcc opteron define switch

  • Thread starter Ilgis Ibragimov
  • Start date
I

Ilgis Ibragimov

Hello,

I would like to write a "C" program that is compatible in x32 and x64
Linux system under GCC environment.
Hence I need a a variable that is definite in x64 and indefinite in x32.
Certainly I can do in as -Dsomething, but I expect that compiler have
some own options.

Would you please to suggest me what kind of variable is definite in x64
and indefinite in x32?

Thank you

Ilgis
 
J

Jens.Toerring

Ilgis Ibragimov said:
I would like to write a "C" program that is compatible in x32 and x64
Linux system under GCC environment.
Hence I need a a variable that is definite in x64 and indefinite in x32.
Certainly I can do in as -Dsomething, but I expect that compiler have
some own options.

That's not a C question but something specific to your compiler.
I would recommend that you ask that in e.g. gnu.gcc.help where
it is not only on-topic but where you will find the people that
know most about these problems.
Regards, Jens
 
M

Mark A. Odell

Hello,

I would like to write a "C" program that is compatible in x32 and x64
Linux system under GCC environment.

But a major point of C is to be platform neutral. There are no x86
switches in the C language. There is no assumed operating system or
compiler. Once you start specifying such things you need to seek an
newsgroup that discusses such things. comp.unix.programmer springs to mind
in this case.
 
C

CBFalconer

Ilgis said:
I would like to write a "C" program that is compatible in x32 and
x64 Linux system under GCC environment.
Hence I need a a variable that is definite in x64 and indefinite in x32.
Certainly I can do in as -Dsomething, but I expect that compiler have
some own options.

Would you please to suggest me what kind of variable is definite in x64
and indefinite in x32?

Exactly what you want is not clear - there is a language barrier.
However I expect you should find suitable values via the
definitions in <limits.h>.
 
I

Ilgis Ibragimov

Hello,

thank everybody who answered to me. I found it in limits.h, there is
__WORDSIZE, and it is definite as 32 for x32, and 64 for x64.

Regards

Ilgis
 
C

CBFalconer

Ilgis said:
thank everybody who answered to me. I found it in limits.h, there is
__WORDSIZE, and it is definite as 32 for x32, and 64 for x64.

That is a non-portable system value, which you should not use.
Use only the values that are defined in the standard. That
includes such things as INT_MAX and INT_MIN.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top