Hi Mark, 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. > 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? 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) || [EMAIL PROTECTED]@ +# include @FULL_PATH_STDINT_H@ +# endif #endif > 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>. Bruno diff -c -3 -r1.18 stdint_.h *** lib/stdint_.h 23 Jun 2006 14:58:59 -0000 1.18 --- lib/stdint_.h 23 Jun 2006 20:52:19 -0000 *************** *** 33,43 **** #if defined(__FreeBSD__) && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4) # include <sys/inttypes.h> #endif ! #if defined(__OpenBSD__) /* 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. */ # include <sys/types.h> # if @HAVE_INTTYPES_H@ # include @FULL_PATH_INTTYPES_H@ --- 33,45 ---- #if defined(__FreeBSD__) && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4) # include <sys/inttypes.h> #endif ! #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. */ + /* IRIX 6.5 has <inttypes.h>, and <sys/types.h> defines some of these + types as well. */ # include <sys/types.h> # if @HAVE_INTTYPES_H@ # include @FULL_PATH_INTTYPES_H@ diff -c -3 -r1.7 stdint.m4 *** m4/stdint.m4 19 Jun 2006 11:27:00 -0000 1.7 --- m4/stdint.m4 23 Jun 2006 20:52:19 -0000 *************** *** 1,4 **** ! # stdint.m4 serial 7 dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, --- 1,4 ---- ! # stdint.m4 serial 8 dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, *************** *** 90,96 **** #if defined(__FreeBSD__) && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4) # include <sys/inttypes.h> #endif ! #if defined(__OpenBSD__) # include <sys/types.h> # if HAVE_INTTYPES_H # include FULL_PATH_INTTYPES_H --- 90,96 ---- #if defined(__FreeBSD__) && (__FreeBSD__ >= 3) && (__FreeBSD__ <= 4) # include <sys/inttypes.h> #endif ! #if defined(__OpenBSD__) || defined(__sgi) # include <sys/types.h> # if HAVE_INTTYPES_H # include FULL_PATH_INTTYPES_H