Is there one in QNX 6? I have checked <sys/types> but didnt see a 64 bit
int. I saw the Quad thing but that would only be good if you could perform
arithmetic functions on the variable. So, is there a fully integrated 64
bit data type?
Jim
Is there one in QNX 6? I have checked <sys/types> but didnt see a 64 bit
int. I saw the Quad thing but that would only be good if you could perform
arithmetic functions on the variable. So, is there a fully integrated 64
bit data type?
Jim
uint64_t and int64_t
They are fully supported, format in printf is %lld
“Jim Lambert” <jlambert@futurex.com> wrote in message
news:9j2btf$lbs$1@inn.qnx.com…
Is there one in QNX 6? I have checked <sys/types> but didnt see a 64 bit
int. I saw the Quad thing but that would only be good if you could
perform
arithmetic functions on the variable. So, is there a fully integrated 64
bit data type?Jim
\
Mario Charest wrote:
uint64_t and int64_t
They are fully supported, format in printf is %lld
and are defined in inttypes.h
“Jim Lambert” <> jlambert@futurex.com> > wrote in message
news:9j2btf$lbs$> 1@inn.qnx.com> …
Is there one in QNX 6? I have checked <sys/types> but didnt see a 64 bit
int. I saw the Quad thing but that would only be good if you could
perform
arithmetic functions on the variable. So, is there a fully integrated 64
bit data type?Jim
\
Alex Guryanow <gav@ets.ifmo.ru> wrote:
Mario Charest wrote:
uint64_t and int64_t
They are fully supported, format in printf is %lld
and are defined in inttypes.h
They are, but including <stdint.h> will probably be more portable
(that’s where the new C standard wants them).
BTW, <inttypes.h> defines macros for printf formatting. If you want to
be more portable, then instead of “%lld” use “%” PRId64 – for example:
int64_t x;
…
printf( “There are %10” PRId64 " things in there\n", x );
Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.
“Wojtek Lerch” <wojtek@qnx.com> wrote in message
news:9j6rr2$4s6$1@nntp.qnx.com…
Alex Guryanow <> gav@ets.ifmo.ru> > wrote:
Mario Charest wrote:uint64_t and int64_t
They are fully supported, format in printf is %lld
and are defined in inttypes.h
They are, but including <stdint.h> will probably be more portable
(that’s where the new C standard wants them).BTW, <inttypes.h> defines macros for printf formatting. If you want to
be more portable, then instead of “%lld” use “%” PRId64 – for example:int64_t x;
…
printf( “There are %10” PRId64 " things in there\n", x );
How come PRIdPTR is “lld” ??? Are pointers 64 bits?
If I compile (-w9):
char buf[20];
printf ( “%d” PRIdPTR “\n”, buf );
That creates a warning. To get rid of the format I must use
printf("%p\n", buf );
the “p” format isn’t defined anywhere in inttypes.h files. Does that means
this format isnt’ really standard nor portable?
(Well, I’m not entirely sure that this makes you more portable today
– the C99 standard is still quite fresh and some compilers might need
some more time to catch up with it…)
\Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.
Mario Charest <mcharest@zinformatic.com> wrote:
How come PRIdPTR is “lld” ??? Are pointers 64 bits?
If I compile (-w9):char buf[20];
printf ( “%d” PRIdPTR “\n”, buf );That creates a warning. To get rid of the format I must use
It creates a warning because PRIdPTR is not for pointers. It’s for
intptr_t.
Still, I don’t know why it’s defined as “lld”. On my machine, intptr_t
comes out as a 32-bit integer.
printf("%p\n", buf );
the “p” format isn’t defined anywhere in inttypes.h files. Does that means
this format isnt’ really standard nor portable?
Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.