[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: stdint module on SGI
From: |
Mark D. Baushke |
Subject: |
Re: stdint module on SGI |
Date: |
Fri, 23 Jun 2006 15:23:15 -0700 |
Hi Bruno,
The CVS forked version is getting closer to the GNULIB version.
(See below).
Bruno Haible <bruno@clisp.org> writes:
> Mark D. Baushke wrote:
> > The following two patches take a closer step toward making things work
> > under the default c89 compiler on SGI boxes.
>
> Thanks for suggesting these. But IRIX 6.5 has the types defined
> in <sys/types.h> and <inttypes.h>, therefore maybe some earlier
> version of IRIX had them only in <sys/types.h>? Therefore the appended
> patch looks safer to me. I committed that.
Okay. The CVS sources need a further bit of
adjustment for both SGI IRIX 5.3 and BSDI BSD/OS
4.2. See the patch below.
> > All files that #include <stdint.h> still get warnings like this one:
> >
> > cc-1035 cc: WARNING File = /usr/include/stdint.h, Line = 5
> > #error directive: This header file is to be used only for c99 mode
> > compilations
> >
> > #error This header file is to be used only for c99 mode compilations
> > ^
> >
> > right now. It might be nice if just the existence of <stdint.h> did not
> > imply that it was useful to the compiler...
>
> Well, that's not the case currently: I assume that when you check
> for <stdint.h> using autoconf's AC_CHECK_HEADERS, it will tell you that
> the file exists?
Yes. It exists, but is useless for any c89
compilation. Also, since SGI makes #error just a
warning, autoconf is unable to figure out that the
file should never be included.
> Hmm, is it nevertheless safe to leave this file aside
> and do as you propose?
>
> #if @HAVE_STDINT_H@
> /* Other systems may have an incomplete <stdint.h>. */
> -# include @FULL_PATH_STDINT_H@
> +# if !defined(__sgi) || !@HAVE_INTTYPES_H@
> +# include @FULL_PATH_STDINT_H@
> +# endif
> #endif
Yes. Larry suggests that the '|| !@HAVE_INTTYPES_H@'
may not be necessary, but I have a dim
recollection that IRIX 4.0 may not yet have had an
<inttypes.h> file, so that is was I was trying to
protect. I suspect that any recent vintage of SGI
box will have an <inttypes.h> and that this will
do the right thing in all cases.
> > Given that a conforming C99 function
> > <inttypes.h> is supposed to include
> > <stdint.h>, I wonder if it makes sense to try
> > to only #include <inttypes.h> and see if that
> > works before attempting to try to #include
> > <stdint.h> along with it.
>
> "<inttypes.h> is supposed to include# <stdint.h>", but the reality is
> different. <inttypes.h> was introduced several years earlier than
> <stdint.h>.
Yes, and a conforming C99 <inttypes.h> file is
forced to #include <stdint.h>. In fact, the SGI
IRIX 5.3 c99 compiler does have <inttypes.h> do
this. When c89 is used, the file is not included,
but all of the needed types are defined. Why they
did it in that manner is beyond my understanding.
-- Mark
2006-06-23 Larry Jones <lawrence.jones@ugs.com>
* stdint_.h: Try harder to find a definition of WCHAR_MIN/MAX.
Combine BSD/OS stuff with OpenBSD/SGI and use the correct
preprocessor symbol.
2006-06-23 Mark D. Baushke <mdb@gnu.org>
* stdint_.h: Both BSD/OS 4.2 and SGI-cc IRIX 5.3 seem to also need
<sys/types.h> included.
Index: lib/stdint_.h
===================================================================
RCS file: /sources/gnulib/gnulib/lib/stdint_.h,v
retrieving revision 1.19
diff -u -p -r1.19 stdint_.h
--- lib/stdint_.h 23 Jun 2006 20:52:39 -0000 1.19
+++ lib/stdint_.h 23 Jun 2006 22:08:50 -0000
@@ -26,6 +26,9 @@
/* Get wchar_t, WCHAR_MIN, WCHAR_MAX. */
#include <stddef.h>
+#if !defined(WCHAR_MIN) && defined(HAVE_WCHAR_H)
+# include <wchar.h>
+#endif
/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */
#include <limits.h>
@@ -33,11 +36,13 @@
#if defined(__FreeBSD__) && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)
# include <sys/inttypes.h>
#endif
+#if defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)
#if defined(__OpenBSD__) || defined(__sgi)
/* In OpenBSD 3.8, <sys/types.h> includes <machine/types.h>, which defines
int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
<inttypes.h> includes <machine/types.h> and also defines intptr_t and
uintptr_t. */
+ /* BSD/OS 4.2 is similar, but doesn't have <inttypes.h> */
/* IRIX 6.5 has <inttypes.h>, and <sys/types.h> defines some of these
types as well. */
# include <sys/types.h>
@@ -66,7 +71,9 @@
#endif
#if @HAVE_STDINT_H@
/* Other systems may have an incomplete <stdint.h>. */
-# include @FULL_PATH_STDINT_H@
+# if !defined(__sgi) || !@HAVE_INTTYPES_H@
+# include @FULL_PATH_STDINT_H@
+# endif
#endif
/* 7.18.1.1. Exact-width integer types */
Index: m4/stdint.m4
===================================================================
RCS file: /sources/gnulib/gnulib/m4/stdint.m4,v
retrieving revision 1.8
diff -u -p -r1.8 stdint.m4
--- m4/stdint.m4 23 Jun 2006 20:52:39 -0000 1.8
+++ m4/stdint.m4 23 Jun 2006 22:08:50 -0000
@@ -90,7 +90,7 @@ typedef int array [2 * (POW63 != 0 && PO
#if defined(__FreeBSD__) && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4)
# include <sys/inttypes.h>
#endif
-#if defined(__OpenBSD__) || defined(__sgi)
+#if defined(__OpenBSD__) || defined(__bsdi__) || defined(__sgi)
# include <sys/types.h>
# if HAVE_INTTYPES_H
# include FULL_PATH_INTTYPES_H
@@ -106,7 +106,9 @@ typedef int array [2 * (POW63 != 0 && PO
# include FULL_PATH_INTTYPES_H
#endif
#if HAVE_STDINT_H
-# include FULL_PATH_STDINT_H
+# if !defined(__sgi) || !HAVE_INTTYPES_H
+# include FULL_PATH_STDINT_H
+# endif
#endif
'
gl_STDINT_CHECK_TYPES(
- stdint module on SGI, Mark D. Baushke, 2006/06/21
- Re: stdint module on SGI, Bruno Haible, 2006/06/23
- Re: stdint module on SGI, Larry Jones, 2006/06/23
- Re: stdint module on SGI,
Mark D. Baushke <=
- Re: stdint module on SGI, Larry Jones, 2006/06/23
- Re: stdint module on SGI, Bruno Haible, 2006/06/26
- Re: stdint module on SGI, Bruno Haible, 2006/06/26
- Re: stdint module on SGI, Larry Jones, 2006/06/26
- Re: stdint module on SGI, Mark D. Baushke, 2006/06/26
- Re: stdint module on SGI, Bruno Haible, 2006/06/26
- Re: stdint module on SGI, Mark D. Baushke, 2006/06/26
- Re: stdint module on SGI, Bruno Haible, 2006/06/26
- Re: stdint module on SGI, Bruno Haible, 2006/06/26
- Re: stdint module on SGI, Bruno Haible, 2006/06/26