public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [patch]: Add check for stdint header
@ 2009-09-04 13:07 Tobias Burnus
  2009-09-04 13:18 ` Kai Tietz
  0 siblings, 1 reply; 21+ messages in thread
From: Tobias Burnus @ 2009-09-04 13:07 UTC (permalink / raw)
  To: gcc patches, Paolo Bonzini, Richard Guenther, Kai Tietz,
	Richard Henderson, Ralf Wildenhues

Paolo Bonzini wrote:
> You can use GCC_STDINT_TYPES (new in this version) instead of
> GCC_HEADER_STDINT since GCC does not need int_leastNN_t and int_fastNN_t.

That is not completely true. The Fortran front end needs to know the
storage size of the int_{least,fast}*_t in order to make the
c_int_{least,fast}*_t kind parameters available in the ISO_C_BINDING
module (for interoperability with C). The size needs to match the one on
the target system in order that C and Fortran can interoperate.

I have not checked whether the change affects this (cf.
gcc/fortran/iso-c-binding.def and users of this file), but one should
check this before submittal.

Tobias

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: [patch]: Add check for stdint header
@ 2009-09-04 12:48 Tobias Burnus
  2009-09-04 12:53 ` Kai Tietz
  0 siblings, 1 reply; 21+ messages in thread
From: Tobias Burnus @ 2009-09-04 12:48 UTC (permalink / raw)
  To: gcc patches, Paolo Bonzini, Richard Guenther, Kai Tietz,
	Richard Henderson, Ralf Wildenhues

Paolo Bonzini wrote:
> You can use GCC_STDINT_TYPES (new in this version) instead of
> GCC_HEADER_STDINT since GCC does not need int_leastNN_t and int_fastNN_t.

That is not completely true. The Fortran front end needs to know the
storage size of the int_{least,fast}*_t in order to make the
c_int_{least,fast}*_t kind parameters available in the ISO_C_BINDING
module (for interoperability with C). The size needs to match the one on
the target system in order that C and Fortran can interoperate.

I have not checked whether the change affects this (cf.
gcc/fortran/iso-c-binding.def and users of this file), but one should
check this before submittal.

Tobias

^ permalink raw reply	[flat|nested] 21+ messages in thread
* [patch]: Add check for stdint header
@ 2009-09-02 22:18 Kai Tietz
  2009-09-03  1:37 ` Kai Tietz
  2009-09-03 10:55 ` Richard Guenther
  0 siblings, 2 replies; 21+ messages in thread
From: Kai Tietz @ 2009-09-02 22:18 UTC (permalink / raw)
  To: GCC Patches, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 707 bytes --]

Hello,

this patch adds to gcc's system.h file the include of stdint.h file,
if present. If it doesn't finds this header it defines uintptr_t as
'unsigned long' and intptr_t as 'long'.

ChangeLog

2009-09-03  Kai Tietz  <kai.tietz@onevision.com>

	* config.in (HAVE_STDINT_H): New.
	* configure.ac (AC_CHECK_HEADERS): Add stdint.h.
	* configure: Regenerated.
	* system.h: Include stdint.h, if present. Or define default
	versions of uintptr_t and intptr_t with long type.

Tested for x86_64-pc-linux, i686-w64-mingw32, and for
x86_64-w64-mingw32. Ok for apply to trunk?

Cheers,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

[-- Attachment #2: stdint.diff --]
[-- Type: application/octet-stream, Size: 8192 bytes --]

Index: gcc/gcc/config.in
===================================================================
--- gcc.orig/gcc/config.in	2009-08-24 08:11:35.000000000 +0200
+++ gcc/gcc/config.in	2009-09-03 00:01:22.464371000 +0200
@@ -1144,6 +1144,9 @@
 #undef HAVE_MALLOC_H
 #endif
 
+#ifndef USED_FOR_TARGET
+#undef HAVE_STDINT_H
+#endif
 
 /* Define to 1 if you have the `mbstowcs' function. */
 #ifndef USED_FOR_TARGET
Index: gcc/gcc/configure.ac
===================================================================
--- gcc.orig/gcc/configure.ac	2009-08-28 21:28:51.000000000 +0200
+++ gcc/gcc/configure.ac	2009-09-03 00:02:42.309371000 +0200
@@ -933,7 +933,8 @@
 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
 		 fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
 		 sys/resource.h sys/param.h sys/times.h sys/stat.h \
-		 direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h)
+		 direct.h malloc.h stdint.h langinfo.h ldfcn.h \
+		 locale.h wchar.h)
 
 # Check for thread headers.
 AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
Index: gcc/gcc/system.h
===================================================================
--- gcc.orig/gcc/system.h	2009-08-27 15:04:09.000000000 +0200
+++ gcc/gcc/system.h	2009-09-03 00:06:55.908371000 +0200
@@ -414,6 +414,13 @@
 extern void *realloc (void *, size_t);
 #endif
 
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#else
+#define uintptr_t unsigned long
+#define intptr_t long
+#endif
+
 /* If the system doesn't provide strsignal, we get it defined in
    libiberty but no declaration is supplied.  */
 #if !defined (HAVE_STRSIGNAL) \
Index: gcc/gcc/configure
===================================================================
--- gcc.orig/gcc/configure	2009-08-28 21:28:51.000000000 +0200
+++ gcc/gcc/configure	2009-09-03 00:13:07.396371000 +0200
@@ -7492,7 +7492,8 @@
 for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \
 		 fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
 		 sys/resource.h sys/param.h sys/times.h sys/stat.h \
-		 direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h
+		 direct.h malloc.h stdint.h langinfo.h ldfcn.h \
+		 locale.h wchar.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_preproc "$LINENO" "$ac_header" "$as_ac_Header"
@@ -11078,13 +11079,13 @@
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:11081: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:11082: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:11084: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:11085: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:11087: output\"" >&5)
+  (eval echo "\"\$as_me:11088: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -12289,7 +12290,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 12292 "configure"' > conftest.$ac_ext
+  echo '#line 12293 "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -13949,11 +13950,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13952: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13953: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13956: \$? = $ac_status" >&5
+   echo "$as_me:13957: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -14288,11 +14289,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14291: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14292: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14295: \$? = $ac_status" >&5
+   echo "$as_me:14296: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -14393,11 +14394,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14396: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14397: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14400: \$? = $ac_status" >&5
+   echo "$as_me:14401: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -14448,11 +14449,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14451: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14452: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14455: \$? = $ac_status" >&5
+   echo "$as_me:14456: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16830,7 +16831,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 16833 "configure"
+#line 16834 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16926,7 +16927,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 16929 "configure"
+#line 16930 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18882,11 +18883,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18885: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18886: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18889: \$? = $ac_status" >&5
+   echo "$as_me:18890: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -18981,11 +18982,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18984: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18985: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:18988: \$? = $ac_status" >&5
+   echo "$as_me:18989: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -19033,11 +19034,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:19036: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19037: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:19040: \$? = $ac_status" >&5
+   echo "$as_me:19041: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized

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

end of thread, other threads:[~2009-09-08 15:22 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-04 13:07 [patch]: Add check for stdint header Tobias Burnus
2009-09-04 13:18 ` Kai Tietz
  -- strict thread matches above, loose matches on Subject: below --
2009-09-04 12:48 Tobias Burnus
2009-09-04 12:53 ` Kai Tietz
2009-09-04 13:18   ` Tobias Burnus
2009-09-04 13:27     ` Paolo Bonzini
2009-09-04 14:07       ` Kai Tietz
2009-09-05 12:41         ` Paolo Bonzini
2009-09-08 15:22           ` Kai Tietz
2009-09-06 10:00       ` Ralf Wildenhues
2009-09-07  6:51         ` Paolo Bonzini
2009-09-02 22:18 Kai Tietz
2009-09-03  1:37 ` Kai Tietz
2009-09-03 10:55 ` Richard Guenther
2009-09-03 11:05   ` Kai Tietz
2009-09-03 11:10     ` Richard Guenther
2009-09-04  7:49       ` Kai Tietz
2009-09-04  9:57         ` Richard Guenther
2009-09-04 10:36           ` Paolo Bonzini
     [not found]             ` <4AA0EE5E.80204@gnu.org>
     [not found]               ` <90baa01f0909040359r45b5b0c1gfb9132cf800bde9b@mail.gmail.com>
     [not found]                 ` <90baa01f0909040534g4ac57551se2e843b861c42a06@mail.gmail.com>
2009-09-04 13:22                   ` Paolo Bonzini
2009-09-06  9:57           ` Ralf Wildenhues

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