Project

General

Profile

Feature #7805

Safer approach to reinterpret_cast

Added by John Freeman almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
02/06/2015
Due date:
02/06/2015
% Done:

100%

Estimated time:
4.00 h
Experiment:
-
Co-Assignees:
Duration: 1

Description

In the artdaq::Fragment class, reinterpret_cast<> is used in multiple locations, particularly when providing users access in the form of a pointer-to-unsigned-1-byte-integer to the vector of 8-byte unsigned integers which represents the underlying data in the fragment. Since it's not a 100% ironclad guarantee in the C++ standard that the pointer returned by reinterpret_cast<> in fact points to the same address as the pointer passed to it (although this is the usual behavior), a wrapper function around reinterpret_cast should be provided which ensures that the returned address is, in fact, what the user thinks it is.

History

#1 Updated by John Freeman almost 6 years ago

  • Tracker changed from Bug to Feature

#2 Updated by Eric Flumerfelt over 5 years ago

  • Status changed from Resolved to Closed
  • Target version set to artdaq_core v1_04_10

Closing issue as it is included in artdaq_core v1_04_10.

Also available in: Atom PDF