This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: 4.0.2/4.1 PATCH: Support LP64 targets without <stdint.h> inlibgfortran
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 6 Jun 2005 19:58:32 +0000 (UTC)
- Subject: Re: 4.0.2/4.1 PATCH: Support LP64 targets without <stdint.h> inlibgfortran
- References: <17060.41846.233721.359830@xayide.TechFak.Uni-Bielefeld.DE>
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)