Morten Ofstad
2004-Oct-19 11:13 UTC
[LLVMdev] Missing default for INT64_MIN in include/llvm/Support/DataTypes.h.in
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? m. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diff.txt URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20041019/8bfae823/attachment.txt>
Misha Brukman
2004-Oct-19 17:45 UTC
[LLVMdev] Missing default for INT64_MIN in include/llvm/Support/DataTypes.h.in
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 > +#endifWhat 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
Reasonably Related Threads
- [LLVMdev] INT64_MIN
- [LLVMdev] Remaining Visual C patches
- [PATCH nbdkit] server: utils: Fix nbdkit_parse_size to correctly handle negative values
- [PATCH nbdkit] server: Move size parsing code (nbdkit_parse_size) to common/include
- [LLVMdev] Hardcoded HAVE_* defines in the DataTypes.h include file