public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* G++ Fundamental Types?
@ 2010-01-14 21:22 Charles Jenkins
  2010-01-14 21:30 ` Brian Budge
  2010-01-15  4:27 ` Ian Lance Taylor
  0 siblings, 2 replies; 4+ messages in thread
From: Charles Jenkins @ 2010-01-14 21:22 UTC (permalink / raw)
  To: gcc-help

I'm sorry to ask such a stupid question, but I am coming from a Borland C++ background, and although I have scoured http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/, I cannot find a list of which fundamental built-in types GCC understands. I believe keywords like  __int8 and __int16 are Borland C++ extensions, and I'd like to know what equivalents I can use in GCC. Where can I find a list of all the basic, built-in types for C++? Thanks!

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

* Re: G++ Fundamental Types?
  2010-01-14 21:22 G++ Fundamental Types? Charles Jenkins
@ 2010-01-14 21:30 ` Brian Budge
  2010-01-16 23:45   ` Patrick Horgan
  2010-01-15  4:27 ` Ian Lance Taylor
  1 sibling, 1 reply; 4+ messages in thread
From: Brian Budge @ 2010-01-14 21:30 UTC (permalink / raw)
  To: Charles Jenkins; +Cc: gcc-help

google gave me this:

http://www.cplusplus.com/doc/tutorial/variables/

Also, if you need certain sizes of integers, I'd recommend looking
into stdint.h (or cstdint in the new standard).

  Brian

On Thu, Jan 14, 2010 at 1:22 PM, Charles Jenkins <cjenkins@tec-usa.com> wrote:
> I'm sorry to ask such a stupid question, but I am coming from a Borland C++ background, and although I have scoured http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/, I cannot find a list of which fundamental built-in types GCC understands. I believe keywords like  __int8 and __int16 are Borland C++ extensions, and I'd like to know what equivalents I can use in GCC. Where can I find a list of all the basic, built-in types for C++? Thanks!
>

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

* Re: G++ Fundamental Types?
  2010-01-14 21:22 G++ Fundamental Types? Charles Jenkins
  2010-01-14 21:30 ` Brian Budge
@ 2010-01-15  4:27 ` Ian Lance Taylor
  1 sibling, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2010-01-15  4:27 UTC (permalink / raw)
  To: Charles Jenkins; +Cc: gcc-help

Charles Jenkins <cjenkins@tec-usa.com> writes:

> I'm sorry to ask such a stupid question, but I am coming from a Borland C++ background, and although I have scoured http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/, I cannot find a list of which fundamental built-in types GCC understands. I believe keywords like  __int8 and __int16 are Borland C++ extensions, and I'd like to know what equivalents I can use in GCC. Where can I find a list of all the basic, built-in types for C++? Thanks!

gcc does not define those sorts of types.  On most modern systems you
can #include <stdint.h> to get standard definitions like int8_t.  In
the upcoming gcc 4.5 release, gcc will provide its own <stdint.h>, so
that it will be reliably available on all systems.

gcc provides an extension which lets you define integer types of
specific sizes:
    typedef int __int8 __attribute__ ((mode (QI)));
I'm not sure I would really recommend using that, though.

Ian

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

* Re: G++ Fundamental Types?
  2010-01-14 21:30 ` Brian Budge
@ 2010-01-16 23:45   ` Patrick Horgan
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick Horgan @ 2010-01-16 23:45 UTC (permalink / raw)
  To: Brian Budge; +Cc: Charles Jenkins, gcc-help

Brian Budge wrote:
> google gave me this:
>
> http://www.cplusplus.com/doc/tutorial/variables/
>
> Also, if you need certain sizes of integers, I'd recommend looking
> into stdint.h (or cstdint in the new standard).
>
>   Brian
>
> On Thu, Jan 14, 2010 at 1:22 PM, Charles Jenkins <cjenkins@tec-usa.com> wrote:
>   
>> I'm sorry to ask such a stupid question, but I am coming from a Borland C++ background, and although I have scoured http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/, I cannot find a list of which fundamental built-in types GCC understands. I believe keywords like  __int8 and __int16 are Borland C++ extensions, and I'd like to know what equivalents I can use in GCC. Where can I find a list of all the basic, built-in types for C++? Thanks!
>>     
The new C++ stuff available by using -std=c++0x to get the tr1 stuff 
from the newer draft C++ Standards, allow the use of (with N 8, 16, or 32):

intN_t, int_fastN_t, int_leastN_t, uintN_t, uint_fastN_t, uint_leastN_t

So for __int8 substitute int8_t, and for __int16 substitute int16_t

Patrick

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

end of thread, other threads:[~2010-01-16 23:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-14 21:22 G++ Fundamental Types? Charles Jenkins
2010-01-14 21:30 ` Brian Budge
2010-01-16 23:45   ` Patrick Horgan
2010-01-15  4:27 ` Ian Lance Taylor

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).