64 bit data type

Hello,

Is there a way to create/use a 64 bit data type in QNX 4.25? I have
tried many different varieties of typedef but the Watcom compiler always
displays an error. I can’t use a structure or an array of 2 integers
because I must be able to use it as a true data type. Why doesn’t QNX
have a standard 64 bit type such as an “int64_t” as in other operating
systems? Are there plans to support a 64 bit data type?

Thanks,
Steve

Steve <stlang@vt.edu> wrote:

Hello,

Is there a way to create/use a 64 bit data type in QNX 4.25? I have
tried many different varieties of typedef but the Watcom compiler always
displays an error. I can’t use a structure or an array of 2 integers
because I must be able to use it as a true data type. Why doesn’t QNX
have a standard 64 bit type such as an “int64_t” as in other operating
systems? Are there plans to support a 64 bit data type?

What’s a “true” data type?

typedef struct { long low, high;
} int64_t;

Is a “true” data type as it has been typedefed.

If you are in C++, you can even make it a class and happily override
+, -, =, /, etc to mean you can just work with it. (And, you should
even be able to handle “promotion” I think.)

In C, you’d have to define int64_t add( int64_t a, b ) etc.

I don’t know of any way of just “getting” operators on these
for free or built-in to Watcom.

(Hm… I don’t know if the GNU C for QNX4 that is available somewhere
on the net would handle 64 bit integers or not. It might, as GNU
C for Neutrino does.)

-David

“David Gibbs” <dagibbs@qnx.com> wrote in message
news:90p4sk$mpm$1@nntp.qnx.com

Steve <> stlang@vt.edu> > wrote:
Hello,

Is there a way to create/use a 64 bit data type in QNX 4.25? I have
tried many different varieties of typedef but the Watcom compiler always
displays an error. I can’t use a structure or an array of 2 integers
because I must be able to use it as a true data type. Why doesn’t QNX
have a standard 64 bit type such as an “int64_t” as in other operating
systems? Are there plans to support a 64 bit data type?

Watcom on QNX4 is dead. It’s very unlikely QNX4 will ever live
to see a compiler update. But i’d love to be proven wrong.

What’s a “true” data type?

typedef struct { long low, high;
} int64_t;

Is a “true” data type as it has been typedefed.

If you are in C++, you can even make it a class and happily override
+, -, =, /, etc to mean you can just work with it. (And, you should
even be able to handle “promotion” I think.)

In C, you’d have to define int64_t add( int64_t a, b ) etc.

I don’t know of any way of just “getting” operators on these
for free or built-in to Watcom.

(Hm… I don’t know if the GNU C for QNX4 that is available somewhere
on the net would handle 64 bit integers or not. It might, as GNU
C for Neutrino does.)

Yes it does.

-David

In :

http://www.qnx.com/cgi-bin/dir_find.cgi?/usr/free/qnx4/os/development/

you’ll find sysdbg.tgz.

It contains among other very interresting things (thanks to Randy Martin), a
file lmath.h wich define some basic operations about 64 bit integer.

It’s a beginning.

Hope this help


Arnauld Disableu
arnauld@disableu.net
http://www.disableu.net

Compatible an 2000
Year 2000 compliant
“Steve” <stlang@vt.edu> a écrit dans le message news:
3A2FC400.D6D0EDB6@vt.edu

Hello,

Is there a way to create/use a 64 bit data type in QNX 4.25? I have
tried many different varieties of typedef but the Watcom compiler always
displays an error. I can’t use a structure or an array of 2 integers
because I must be able to use it as a true data type. Why doesn’t QNX
have a standard 64 bit type such as an “int64_t” as in other operating
systems? Are there plans to support a 64 bit data type?

Thanks,
Steve

Yes, it is true that I can simply typedef a structure to create my own 64 bit
data type. However since I am using C, this does require that I create
functions to perform all the 64 bit data type operations. This is a huge
problem for me since I am trying to port existing 64 bit code to QNX. This
would require that I change every 64 bit operation from a simple operator (=, +,
-, /, *) to a function call (e.g. int64_t add( int64_t a, b )). This is
incredibly time consuming and doesn’t seem like it’s worth the effort.

So I just have a couple more questions for you since this does not seem possible
with my current setup:

1.) Does anyone know if the gnu compiler for QNX supports a native 64 bit type?

2.) What exactly did you mean when you said, “It’s very unlikely QNX4 will ever
live to see a compiler update”? Does this mean that just QNX4 will never have a
new compiler, but there will be a new version of QNX sometime soon that will
have a new compiler? Or does it mean that there will just never be a new
compiler for QNX in general?

Thanks again,
Steve

Mario Charest wrote:

“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:90p4sk$mpm$> 1@nntp.qnx.com> …
Steve <> stlang@vt.edu> > wrote:
Hello,

Is there a way to create/use a 64 bit data type in QNX 4.25? I have
tried many different varieties of typedef but the Watcom compiler always
displays an error. I can’t use a structure or an array of 2 integers
because I must be able to use it as a true data type. Why doesn’t QNX
have a standard 64 bit type such as an “int64_t” as in other operating
systems? Are there plans to support a 64 bit data type?

Watcom on QNX4 is dead. It’s very unlikely QNX4 will ever live
to see a compiler update. But i’d love to be proven wrong.


What’s a “true” data type?

typedef struct { long low, high;
} int64_t;

Is a “true” data type as it has been typedefed.

If you are in C++, you can even make it a class and happily override
+, -, =, /, etc to mean you can just work with it. (And, you should
even be able to handle “promotion” I think.)

In C, you’d have to define int64_t add( int64_t a, b ) etc.

I don’t know of any way of just “getting” operators on these
for free or built-in to Watcom.

(Hm… I don’t know if the GNU C for QNX4 that is available somewhere
on the net would handle 64 bit integers or not. It might, as GNU
C for Neutrino does.)

Yes it does.


-David

“Steve” <stlang@vt.edu> wrote in message news:3A30B8D0.4C76FC0D@vt.edu

Yes, it is true that I can simply typedef a structure to create my own 64
bit
data type. However since I am using C, this does require that I create
functions to perform all the 64 bit data type operations. This is a huge
problem for me since I am trying to port existing 64 bit code to QNX.
This
would require that I change every 64 bit operation from a simple operator
(=, +,
-, /, *) to a function call (e.g. int64_t add( int64_t a, b )). This is
incredibly time consuming and doesn’t seem like it’s worth the effort.

So I just have a couple more questions for you since this does not seem
possible
with my current setup:

1.) Does anyone know if the gnu compiler for QNX supports a native 64 bit
type?

It appears ( I just did a quick try ) that GCC 2.8.? for QNX4 doesn’t
support
int64. However it does on QRTP (GCC 2.9.?)

2.) What exactly did you mean when you said, “It’s very unlikely QNX4 will
ever
live to see a compiler update”? Does this mean that just QNX4 will never
have a
new compiler,

That’s my guess.

but there will be a new version of QNX sometime soon that will
have a new compiler?

Yes it’s called QRTP (Neutrino).

Or does it mean that there will just never be a new
compiler for QNX in general?

Thanks again,
Steve

Mario Charest wrote:

“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:90p4sk$mpm$> 1@nntp.qnx.com> …
Steve <> stlang@vt.edu> > wrote:
Hello,

Is there a way to create/use a 64 bit data type in QNX 4.25? I have
tried many different varieties of typedef but the Watcom compiler
always
displays an error. I can’t use a structure or an array of 2
integers
because I must be able to use it as a true data type. Why doesn’t
QNX
have a standard 64 bit type such as an “int64_t” as in other
operating
systems? Are there plans to support a 64 bit data type?

Watcom on QNX4 is dead. It’s very unlikely QNX4 will ever live
to see a compiler update. But i’d love to be proven wrong.


What’s a “true” data type?

typedef struct { long low, high;
} int64_t;

Is a “true” data type as it has been typedefed.

If you are in C++, you can even make it a class and happily override
+, -, =, /, etc to mean you can just work with it. (And, you should
even be able to handle “promotion” I think.)

In C, you’d have to define int64_t add( int64_t a, b ) etc.

I don’t know of any way of just “getting” operators on these
for free or built-in to Watcom.

(Hm… I don’t know if the GNU C for QNX4 that is available somewhere
on the net would handle 64 bit integers or not. It might, as GNU
C for Neutrino does.)

Yes it does.


-David