Operating System - HP-UX
1829961 Members
2019 Online
109998 Solutions
New Discussion

HP-UX Itanium 64 - C Support for int 32

 
abadreamer
Occasional Contributor

HP-UX Itanium 64 - C Support for int 32

I have an old program written in C, we need to use int32 on it, what is the appropriate type to use? is it "int32" or what?
4 REPLIES 4
Steven Schweda
Honored Contributor

Re: HP-UX Itanium 64 - C Support for int 32

> [...] written in C [...]

Whose C? For what?

If I _knew_ what your "int32" was, then I
might be able to suggest a standard type to
use for it. I can _guess_ that it's a 32-bit
signed integer, so I'd guess that "int" would
be suitable.

Invisible code can be hard for us
non-psychics to interpret.
abadreamer
Occasional Contributor

Re: HP-UX Itanium 64 - C Support for int 32

Thanks for reply
I mean written in ANSI-C programming language, i though C was obvious.
i'm compiling on HP Itanium 64bit, and i need to define an integer variable of 32 bit length, can any one help in this, for example in Solaris i use something like
typedef signed int32 TYP_INT32;

thanks for your reply
Steven Schweda
Honored Contributor

Re: HP-UX Itanium 64 - C Support for int 32

> [...] i need to define an integer variable
> of 32 bit length [...]

Then say that. With my weak psychic powers,
I don't know what "int32" means to you.

> [...] i though C was obvious. [...]

C may be obvious. What you want is another
question.

> in Solaris i use something like
> typedef signed int32 TYP_INT32;

Why? What's wrong with plain, old,
ANSI-standard "int"?

dyi # cat siz.c
#include

main()
{
printf( " char = %d, int = %d, long = %d, long long = %d, void* = %d.\n",
sizeof( char), sizeof( int), sizeof( long),
sizeof( long long), sizeof( void *));
}

dyi # cc -o siz siz.c

dyi # ./siz
char = 1, int = 4, long = 4, long long = 8, void* = 4.

Looks to me like 32 bits.

dyi # uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license

dyi # cc -V
(Bundled) cc: HP C/aC++ B3910B A.06.12 [Oct 11 2006]
Dennis Handly
Acclaimed Contributor

Re: HP-UX Integrity - C Support for int32

You can just use int. If you want to use int32_t, you can include <inttypes.h>.