Re: SOLVED: Compile issue on Linux x86_64
Daniel Wallin <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Feb 16, 2010 at 01:54:58PM -0800, Thomas Nelson wrote: > Attached is the diff, you will need to adjust the file paths. > > The problem: It seems that 64bit gcc 4.4.3-4 may be a bit pedantic when it > comes to template expansion. When presented with the following: > > std::pair<void*, int>(0, -1) > > It decides that the "0" is an integer which could not possibly under any > circumstances be considered a void * to NULL, or at least not in any sane > world that you and I might inhabit. Therefore the programmer is obviously > attempting to initialize a std::pair<void*, int> with a std:pair<int, int> > and this is just not done in polite circles. Throwing up its hands in > disgust at those silly programmers it spits out a helpful message, exits and > goes for a beer. > > Solution: Explain politely to gcc that yes, that really is a void pointer to > null and not the integer 0. > > std::pair<void*, int>(static_cast<void *>(0), -1) > > I was always under the impression that integer 0 would always be considered > a pointer if used in a context like this. Thank you! Applied to the 0.9 branch, except I changed static_cast<void*>(p) to (void*)p. -- Daniel Wallin BoostPro Computing http://www.boostpro.com ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev