ISSUE: INT64_MAX undefined in InstrSelectionSupport.cpp and InstructionCombining.cpp. I'm not completely sure where INT64_MAX comes from on Solaris, but C99 says that INT64_MAX is defined in stdint.h, but, for C++, only if __STDC_LIMIT_MACROS is #defined. Solaris (at least in CSIL) unfortunately does not have stdint.h, but it does have the old inttypes.h - and so does Linux. ACTION: In files that refer to INT64_MAX, ensure that inttypes.h is #included and that __STD_LIMIT_MACROS is #defined before _any_ #include (you never know which header includes what header on whatever system, so paranoia is good). PATCH: Apply from llvm top level directory with "patch -p0." -- Casey Carter Casey at Carter.net ccarter at uiuc.edu AIM: cartec69 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20020913/c34eb6e2/attachment.ksh>
> ISSUE: INT64_MAX undefined in InstrSelectionSupport.cpp and > InstructionCombining.cpp. I'm not completely sure where INT64_MAX comes > from on Solaris, but C99 says that INT64_MAX is defined in stdint.h, > but, for C++, only if __STDC_LIMIT_MACROS is #defined. Solaris (at > least in CSIL) unfortunately does not have stdint.h, but it does have > the old inttypes.h - and so does Linux.Interesting. INT64_MAX is supposed to be provided by include/Support/DataTypes.h. Do you know of a reliable preprocessor symbol that can be used to determine whether we're on a linux box, or (better yet) whether the system has a valid <stdint.h>? Thanks, -Chris http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/
Chris Lattner wrote:>>ISSUE: INT64_MAX undefined in InstrSelectionSupport.cpp and >>InstructionCombining.cpp. I'm not completely sure where INT64_MAX comes >>from on Solaris, but C99 says that INT64_MAX is defined in stdint.h, >>but, for C++, only if __STDC_LIMIT_MACROS is #defined. Solaris (at >>least in CSIL) unfortunately does not have stdint.h, but it does have >>the old inttypes.h - and so does Linux. >> >> > >Interesting. INT64_MAX is supposed to be provided by >include/Support/DataTypes.h. Do you know of a reliable preprocessor >symbol that can be used to determine whether we're on a linux box, or > >Well, there is always __linux__, but that doesn't necessarily imply that we are on a Linux box with stdint.h.>(better yet) whether the system has a valid <stdint.h>? > >Nope. Autoconf is definitely the way to go here (even though converting is a pain).>Thanks, > >-Chris > >http://llvm.cs.uiuc.edu/ >http://www.nondot.org/~sabre/Projects/ > >-- Casey Carter Casey at Carter.net ccarter at uiuc.edu AIM: cartec69