Bug #12391
PtrVectorBase member data could undergo narrowing conversion when reading a linux-produced data file on a Mac.
0%
Description
art::PtrVectorBase
has a member datum indicies_
of type indices_t
, which is a typedef to std::vector<key_type>
, key_type
being itself a typedef to unsigned long
. ROOT 5+ always stores this as 64 bits, but upon reading on OS X, it is narrowed to 32 bits.
In order to avoid the possibility of undesired narrowing, we should change the typedef of key_type
to unsigned long long
. This will not increase IO storage requirements, and will increase in-memory storage requirements only on OS X.
We should also survey art suite code for other examples of the same phenomenon.
History
#1 Updated by Christopher Green almost 5 years ago
- Project changed from cet-is to art
#2 Updated by Rob Kutschke almost 5 years ago
Please also check cet::map_vector<T> - it has a key type
unsigned long
Mu2e needs a 64 bit key.
#3 Updated by Kyle Knoepfel almost 5 years ago
- Status changed from New to Rejected
Chris says to reject this: unsigned long
is 8 bytes on both systems. This was a misreading of consequences of a different problem (std::size_t
typedef
on OSX vs. Linux).