G++ Fundamental Types?

Ian Lance Taylor iant@google.com
Fri Jan 15 04:27:00 GMT 2010


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



More information about the Gcc-help mailing list