[LLVMdev] Missing default for INT64_MIN in include/llvm/Support/DataTypes.h.in

Misha Brukman brukman at uiuc.edu
Tue Oct 19 10:45:39 PDT 2004


On Tue, Oct 19, 2004 at 01:13:30PM +0200, Morten Ofstad wrote:
> Here is a patch -- on a side note I see that a patch checking _MSC_VER 
> has gone in which defines a lot of limits that should really come from 
> <limits.h> ... Anyone care to comment on this?
[snip]
> RCS file: /var/cvs/llvm/llvm/include/llvm/Support/DataTypes.h.in,v
> +#if !defined(INT64_MIN)
> +# define INT64_MIN -9223372036854775808LL
> +#endif

What I gathered from my discussion on #gcc, that is not a valid int64_t
because the tokenizer will treat those as two tokens: - and NUMBER, and
since NUMBER > INT64_MAX, it's not a valid integer.  As a result, this
file will not compile with GCC.

The solution is to define INT64_MIN as (-INT64_MAX-1) .

-- 
Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu




More information about the llvm-dev mailing list