Project

General

Profile

Bug #12391

PtrVectorBase member data could undergo narrowing conversion when reading a linux-produced data file on a Mac.

Added by Christopher Green about 3 years ago. Updated about 3 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
04/25/2016
Due date:
% Done:

0%

Estimated time:
Occurs In:
Scope:
Internal
Experiment:
-
SSI Package:
Duration:

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 about 3 years ago

  • Project changed from cet-is to art

#2 Updated by Rob Kutschke about 3 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 about 3 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).



Also available in: Atom PDF