Hello, I am getting a compile warning when building R from source. I am building on a AMD64 Opteron system with gcc (GCC) 3.3.3 (SuSE Linux) The warning is: unique.c: In function `cshash': unique.c:1146: warning: cast from pointer to integer of different size Thanks, Michael [[alternative HTML version deleted]]
On Mon, 29 Aug 2005, Harris, Michael (NIH/NCI) [E] wrote:> I am getting a compile warning when building R from source. I am building > on a AMD64 Opteron system with gcc (GCC) 3.3.3 (SuSE Linux) > > The warning is: > > unique.c: In function `cshash': > > unique.c:1146: warning: cast from pointer to integer of different sizeHave you bothered to read the code? The comment there should explain this to you. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Mon, 29 Aug 2005, Harris, Michael (NIH/NCI) [E] wrote:> > I am getting a compile warning when building R from source. I am building > on a AMD64 Opteron system with gcc (GCC) 3.3.3 (SuSE Linux) > > The warning is: > > unique.c: In function `cshash': > > unique.c:1146: warning: cast from pointer to integer of different size >The comment immediately above this suggests that it is deliberate /* Use hashing to improve object.size. Here we want equal CHARSXPs, not equal contents. This only uses the bottom 32 bits of the pointer, but for now that's almost certainly OK */ The warning is presumably because casting this int back to a pointer would fail (and is a common 32 to 64bit conversion error), but that's not what is happening here. -thomas