Red Hat Bugzilla – Bug 1304102
Rinterface.h redefines uintptr_t
Last modified: 2017-08-08 08:44:12 EDT
Description of problem:
Trying to compile vtk 7 with gcc 6 I get:
In file included from /builddir/build/BUILD/VTK-7.0.0/Filters/StatisticsGnuR/vtkRInterface.cxx:47:0:
/usr/lib/R/include/Rinterface.h:98:24: error: conflicting declaration 'typedef long unsigned int uintptr_t'
typedef unsigned long uintptr_t;
In file included from /usr/lib/gcc/i686-redhat-linux/6.0.0/include/stdint.h:9:0,
/usr/include/stdint.h:128:23: note: previous declaration as 'typedef unsigned int uintptr_t'
typedef unsigned int uintptr_t;
Version-Release number of selected component (if applicable):
#if !defined(HAVE_UINTPTR_T) && !defined(uintptr_t)
typedef unsigned long uintptr_t;
but neither of those guards appear to be sufficient.
Just a thought, but can you add -DHAVE_UINTPTR_T to the VTK7 optflags? If that works, then perhaps VTK7 needs to do a proper configure check for uintptr_t.
I feel like R is properly guarded here...
I thought about that as a workaround, but the whole "HAVE_UINTPTR_T" thing is an autotools construct and vtk uses cmake. Some downstream consumer of R shouldn't have to know how to tweak its headers. I would argue that R should do one of: not place the definition in the header if not needed, include its own (properly namespaced) config header that sets HAVE_UINTPTR_T, or define HAVE_UINTPTR_T appropriately in Rinterface.h.
gcc is defining uintptr_t in stdint... so I'm not sure how it's getting undefined when Rinterface.h is parsed. I feel like #if !defined(uintptr_t) is perfectly valid... I just suggested HAVE_UINTPTR_T as a possible workaround.
In fact, nothing seems to have changed in /usr/include/stdint.h with regards to how uintptr_t is defined (between 5.3.3 and 6.0.0). Perhaps this is a VTK7 specific change?
Based on mailing list history, I'm pretty sure R will be reluctant to drop this typedef, as they're trying to cover cases where uintptr_t is not defined. If we can figure out an additional guard that resolves the VTK7 case, I could propose that.
It's not getting undefined. #ifdef tests for the existence of macros, but uintptr_t is not a macro, it's a typedef. If the typedef were equivalent, the compiler should not complain, but it appears that R is not defining it consistent with stdint.
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.
More information and reason for this action is here:
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora 'version'
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.