public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: stdint.h type information needed
@ 2009-04-03 10:23 FX
  2009-04-03 11:50 ` Dave Korn
  0 siblings, 1 reply; 20+ messages in thread
From: FX @ 2009-04-03 10:23 UTC (permalink / raw)
  To: gcc; +Cc: dave.korn.cygwin, Joseph S. Myers

 >> for some reason identifier_global_value() on it returns NULL.
 > ... and this is presumably because it should have /already/ been  
declared somehow.

I have exactly the same issue on darwin, it segfaults on:

>   char16_type_node = TREE_TYPE (identifier_global_value  
> (char16_type_node));

because identifier_global_value (char16_type_node) is NULL. The patch  
I use is attached. Joseph, could you help us to proceed further?

Thanks,
FX





diff -pur trunk.unmodified/gcc/config/darwin.h trunk/gcc/config/darwin.h
--- trunk.unmodified/gcc/config/darwin.h	2009-04-03 10:48:59.000000000  
+0530
+++ trunk/gcc/config/darwin.h	2009-04-03 15:23:31.000000000 +0530
@@ -72,6 +72,38 @@ Boston, MA 02110-1301, USA.  */
  #undef	WCHAR_TYPE_SIZE
  #define WCHAR_TYPE_SIZE 32

+#define INT8_TYPE "signed char"
+#define INT16_TYPE "short int"
+#define INT32_TYPE "int"
+#define INT64_TYPE "long long int"
+#define UINT8_TYPE "unsigned char"
+#define UINT16_TYPE "unsigned short int"
+#define UINT32_TYPE "unsigned int"
+#define UINT64_TYPE "unsigned long long int"
+
+#define INT_LEAST8_TYPE "signed char"
+#define INT_LEAST16_TYPE "short int"
+#define INT_LEAST32_TYPE "int"
+#define INT_LEAST64_TYPE "long long int"
+#define UINT_LEAST8_TYPE "unsigned char"
+#define UINT_LEAST16_TYPE "unsigned short int"
+#define UINT_LEAST32_TYPE "unsigned int"
+#define UINT_LEAST64_TYPE "unsigned long long int"
+
+#define INT_FAST8_TYPE "signed char"
+#define INT_FAST16_TYPE "short int"
+#define INT_FAST32_TYPE "int"
+#define INT_FAST64_TYPE "long long int"
+#define UINT_FAST8_TYPE "unsigned char"
+#define UINT_FAST16_TYPE "unsigned short int"
+#define UINT_FAST32_TYPE "unsigned int"
+#define UINT_FAST64_TYPE "unsigned long long int"
+
+#define INTPTR_TYPE "long int"
+#define UINTPTR_TYPE "unsigned long int"
+
+#define SIG_ATOMIC_TYPE "int"
+
  /* Default to using the NeXT-style runtime, since that's what is
     pre-installed on Darwin systems.  */

pur trunk.unmodified/gcc/config.gcc trunk/gcc/config.gcc
--- trunk.unmodified/gcc/config.gcc	2009-04-03 10:49:00.000000000 +0530
+++ trunk/gcc/config.gcc	2009-04-03 11:04:52.000000000 +0530
@@ -411,6 +411,7 @@ case ${target} in
    extra_objs="darwin.o"
    extra_gcc_objs="darwin-driver.o"
    default_use_cxa_atexit=yes
+  use_gcc_stdint=wrap
    case ${enable_threads} in
      "" | yes | posix) thread_file='posix' ;;
    esac

^ permalink raw reply	[flat|nested] 20+ messages in thread
* stdint.h type information needed
@ 2009-04-01  0:53 Joseph S. Myers
  2009-04-01  1:25 ` DJ Delorie
  2009-04-01  8:44 ` Bernd Roesch
  0 siblings, 2 replies; 20+ messages in thread
From: Joseph S. Myers @ 2009-04-01  0:53 UTC (permalink / raw)
  To: gcc

GCC now supports providing the header <stdint.h> (required by C99 of 
freestanding implementations) and having information within the compiler 
about the types used in this header.  For further discussion of this and 
its benefits, see 
<http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00305.html>.

Right now, the information is present in GCC for targets using glibc or 
uClibc, bare-metal and RTEMS targets (which are taken to use newlib's 
default stdint.h types) and Solaris targets.  To get the full benefits of 
this support, the information needs adding for all OSes supported by GCC.  
This is information about all the types C99 specifies for <stdint.h>, plus 
sig_atomic_t whose limits go in that header.

To add information for a target OS, put definitions such as those in 
glibc-stdint.h, newlib-stdint.h or sol2.h in a suitable target header, and 
set use_gcc_stdint in config.gcc.  It should be set to "wrap" if the 
system has its own stdint.h header, or "provide" if it doesn't.  (There 
might be special cases when some other arrangement is needed, but I expect 
those two generally to suffice.)  Make sure the new c99-stdint-*.c tests 
pass; if they show up bugs in the system's stdint.h header (as wrapped by 
GCC with the "wrap" setting) then report those upstream and fix them in 
GCC with fixincludes.

If the system does not have stdint.h, then suitable types may be found in 
one of the following places:

* A later OS version.

* inttypes.h (some systems have headers from C9x drafts that had only 
inttypes.h and not stdint.h).

* Other headers such as sys/types.h, including possibly variant type names 
such as u_int32_t in those headers.

* As a last resort, for OSes that are no longer maintained or whose 
maintainers have had no interest in defining those types for the OS, the 
types may be invented for GCC.

At least the following OSes need the information added (for all supported 
architectures):

* Darwin
* FreeBSD
* NetBSD
* OpenBSD
* VxWorks
* alpha*-dec-osf[45]*
* VMS
* SymbianOS
* WinCE
* HP-UX
* DJGPP
* LynxOS
* Netware
* QNX
* Cygwin
* MinGW
* Interix
* IRIX
* AIX
* s390x-ibm-tpf*

-- 
Joseph S. Myers
joseph@codesourcery.com

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

end of thread, other threads:[~2009-04-08  9:04 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-03 10:23 stdint.h type information needed FX
2009-04-03 11:50 ` Dave Korn
2009-04-03 12:20   ` FX
2009-04-03 12:23     ` Dave Korn
2009-04-03 13:48       ` [SOLVED] " Dave Korn
2009-04-03 18:30         ` FX
2009-04-03 19:16           ` Dave Korn
2009-04-08  0:37         ` [SOLVED] " Joseph S. Myers
2009-04-08 11:01           ` Dave Korn
  -- strict thread matches above, loose matches on Subject: below --
2009-04-01  0:53 Joseph S. Myers
2009-04-01  1:25 ` DJ Delorie
2009-04-01  1:57   ` Joseph S. Myers
2009-04-01  2:14     ` DJ Delorie
2009-04-01 12:42       ` Joseph S. Myers
2009-04-01 12:53         ` Dave Korn
2009-04-02  6:44           ` Dave Korn
2009-04-02  9:10             ` Dave Korn
2009-04-03 10:07               ` Dave Korn
2009-04-01  8:44 ` Bernd Roesch
2009-04-01 12:47   ` Joseph S. Myers

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