This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 4.0.2/4.1 PATCH: Support LP64 targets without <stdint.h> inlibgfortran

On Mon, 6 Jun 2005, Rainer Orth wrote:

> +  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      (personal mail) (CodeSourcery mail) (Bugzilla assignments and CCs)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]