public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Does Cygwin's GCC support 64-bit constants?
@ 2004-03-02 23:16 Nate Iverson
  2004-03-03  2:39 ` Eljay Love-Jensen
  0 siblings, 1 reply; 4+ messages in thread
From: Nate Iverson @ 2004-03-02 23:16 UTC (permalink / raw)
  To: gcc-help

I'm getting the following warning message when I try to compile source code that contains 0xFF00000000000000 as a constant.
warning: integer constant is too large for "long" type

Cywin's GCC appears to have 64-bit integer support since there are no warnings/errors for uint64_t variables.

Below are the gcc details:
$ gcc -v
Reading specs from /bin/../lib/gcc-lib/i686-pc-cygwin/3.3.1/specs
Configured with: /GCC/gcc-3.3.1-3/configure --with-gcc --with-gnu-ld --with-gnu-as --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/sbin --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,ada,c++,f77,pascal,java,objc --enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls --without-included-gettext --enable-interpreter --enable-sjlj-exceptions --disable-version-specific-runtime-libs --enable-shared --disable-win32-registry --enable-java-gc=boehm --disable-hash-synchronization --verbose --target=i686-pc-cygwin --host=i686-pc-cygwin --build=i686-pc-cygwin
Thread model: posix
gcc version 3.3.1 (cygming special)

I have also tried to cast the constant (long long)0xFF00000000000000 -- it didn't change anything. Additionally, I have compiled this on Linux and QNX with no issues.

Any insight is appreciated,
Nate


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Does Cygwin's GCC support 64-bit constants?
  2004-03-02 23:16 Does Cygwin's GCC support 64-bit constants? Nate Iverson
@ 2004-03-03  2:39 ` Eljay Love-Jensen
  0 siblings, 0 replies; 4+ messages in thread
From: Eljay Love-Jensen @ 2004-03-03  2:39 UTC (permalink / raw)
  To: Nate Iverson, gcc-help

Hi Nate,

Use this:

#include <stdint.h>
const int64_t myvar = INT64_C(0xFF00000000000000);

Note, <stdint.h> is part of C99, it's in GCC 3.3 (maybe earlier), and you 
can use <stdint.h> in your C++ program.  That's <stdint.h> in C++, not 
<cstdint> as one my presuppose ... not yet at least.

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Does Cygwin's GCC support 64-bit constants?
  2004-03-02 23:17 lrtaylor
@ 2004-03-03  0:22 ` Mark Woollard
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Woollard @ 2004-03-03  0:22 UTC (permalink / raw)
  To: gcc-help; +Cc: gcc-help

I think you need LL for 64bit constants.

Mark

On 2 Mar 2004, at 23:17, lrtaylor@micron.com wrote:

> Try adding 'L' to the end of the constant:
>
> 0xFF00000000000000L
>
> That tells the compiler that it's a long and not an integer.
>
> Cheers,
> Lyle
>
>
> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
> Behalf Of Nate Iverson
> Sent: Tuesday, March 02, 2004 4:16 PM
> To: gcc-help@gcc.gnu.org
> Subject: Does Cygwin's GCC support 64-bit constants?
>
> I'm getting the following warning message when I try to compile source
> code that contains 0xFF00000000000000 as a constant.
> warning: integer constant is too large for "long" type
>
> Cywin's GCC appears to have 64-bit integer support since there are no
> warnings/errors for uint64_t variables.
>
> Below are the gcc details:
> $ gcc -v
> Reading specs from /bin/../lib/gcc-lib/i686-pc-cygwin/3.3.1/specs
> Configured with: /GCC/gcc-3.3.1-3/configure --with-gcc --with-gnu-ld
> --with-gnu-as --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
> --libdir=/usr/lib --libexecdir=/usr/sbin --mandir=/usr/share/man
> --infodir=/usr/share/info
> --enable-languages=c,ada,c++,f77,pascal,java,objc --enable-libgcj
> --enable-threads=posix --with-system-zlib --enable-nls
> --without-included-gettext --enable-interpreter 
> --enable-sjlj-exceptions
> --disable-version-specific-runtime-libs --enable-shared
> --disable-win32-registry --enable-java-gc=boehm
> --disable-hash-synchronization --verbose --target=i686-pc-cygwin
> --host=i686-pc-cygwin --build=i686-pc-cygwin
> Thread model: posix
> gcc version 3.3.1 (cygming special)
>
> I have also tried to cast the constant (long long)0xFF00000000000000 --
> it didn't change anything. Additionally, I have compiled this on Linux
> and QNX with no issues.
>
> Any insight is appreciated,
> Nate
>
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Does Cygwin's GCC support 64-bit constants?
@ 2004-03-02 23:17 lrtaylor
  2004-03-03  0:22 ` Mark Woollard
  0 siblings, 1 reply; 4+ messages in thread
From: lrtaylor @ 2004-03-02 23:17 UTC (permalink / raw)
  To: niverson, gcc-help

Try adding 'L' to the end of the constant:

0xFF00000000000000L

That tells the compiler that it's a long and not an integer.

Cheers,
Lyle


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Nate Iverson
Sent: Tuesday, March 02, 2004 4:16 PM
To: gcc-help@gcc.gnu.org
Subject: Does Cygwin's GCC support 64-bit constants?

I'm getting the following warning message when I try to compile source
code that contains 0xFF00000000000000 as a constant.
warning: integer constant is too large for "long" type

Cywin's GCC appears to have 64-bit integer support since there are no
warnings/errors for uint64_t variables.

Below are the gcc details:
$ gcc -v
Reading specs from /bin/../lib/gcc-lib/i686-pc-cygwin/3.3.1/specs
Configured with: /GCC/gcc-3.3.1-3/configure --with-gcc --with-gnu-ld
--with-gnu-as --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
--libdir=/usr/lib --libexecdir=/usr/sbin --mandir=/usr/share/man
--infodir=/usr/share/info
--enable-languages=c,ada,c++,f77,pascal,java,objc --enable-libgcj
--enable-threads=posix --with-system-zlib --enable-nls
--without-included-gettext --enable-interpreter --enable-sjlj-exceptions
--disable-version-specific-runtime-libs --enable-shared
--disable-win32-registry --enable-java-gc=boehm
--disable-hash-synchronization --verbose --target=i686-pc-cygwin
--host=i686-pc-cygwin --build=i686-pc-cygwin
Thread model: posix
gcc version 3.3.1 (cygming special)

I have also tried to cast the constant (long long)0xFF00000000000000 --
it didn't change anything. Additionally, I have compiled this on Linux
and QNX with no issues.

Any insight is appreciated,
Nate


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-03-03  2:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-02 23:16 Does Cygwin's GCC support 64-bit constants? Nate Iverson
2004-03-03  2:39 ` Eljay Love-Jensen
2004-03-02 23:17 lrtaylor
2004-03-03  0:22 ` Mark Woollard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).