4.0.2/4.1 PATCH: Support LP64 targets without <stdint.h> in libgfortran
Joseph S. Myers
joseph@codesourcery.com
Mon Jun 6 19:58:00 GMT 2005
On Mon, 6 Jun 2005, Rainer Orth wrote:
> +AC_DEFUN([LIBGFOR_TARGET_LP64], [
> + AC_CACHE_CHECK([whether the target is LP64], target_lp64, [
> + save_CFLAGS="$CFLAGS"
> + CFLAGS="-O2"
> + AC_TRY_LINK(,[
> +if (sizeof(int) == 4 && sizeof(long) == 8 && sizeof(void *) == 8)
I realise this follows existing practice in libgfortran, but I don't see
anything in the code in fact depending on the size of pointers. What you
actually depend on is the size of char, short, int, long and long long,
but the tests test for a subset of those and also for pointers. The code
presently does
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
(which looks wrong for int8_t on systems where plain char is unsigned).
If configure tests are used then AC_CHECK_SIZEOF for the relevant types
would seem better, but I don't see the need for configure tests instead of
including <limits.h> and checking the limits of types that way.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)
More information about the Fortran
mailing list