View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003353||1 - Backlog||Maintenance||public||2019-06-15 13:34||2020-07-16 04:27|
|Summary||0003353: different Registry.H files use the same include guard macro name|
|Description||Some of the code uses #ifdef include guards to avoid including the content of a header file twice. This works, though it's nice to replace it with #pragma once.|
In once case, some code has been copy-pasted throughout the project ... and the name of the include guard is the same. There are cases where the file protected is included multiple times, even though the file is actually different because it's of the same name, in a different directory, and with slightly different content.
#if !defined(AFX_REGISTRY_H__E4305AB9_5EA7_45A1_882D_CB00AB460C63__INCLUDED_) #define AFX_REGISTRY_H__E4305AB9_5EA7_45A1_882D_CB00AB460C63__INCLUDED_
|Steps To Reproduce|
1) Do a build
2) Edit Common\Registry.h to remove the #ifdef include guard, leaving only the #pragma once directive
3) Build again (not a rebuild)
BUG#1) The build breaks, the compiler actually has an ICE as a result.
|Tags||No tags attached.|
There are several versions of this header:
C:\hrd67\Common\Registry.h C:\hrd67\Digital Master\Digital Master\Registry.h C:\hrd67\Digital Master\MultiModeTest\Registry.h C:\hrd67\Logbook\HRDLogbook\Registry.h C:\hrd67\Rotator\Registry.h C:\hrd67\Satellites\SatTrack\Registry.h
The header has an unfortunate architecture as it uses a #defined preprocessor symbol to set a part of the root path to the registry entries managed by the class. The preprocessor symbol won't be available to the code when it is compiled into the HRDCommon library, so an alternative architecture should be constructed.
The Digital Master version of the code seems to be the best place to start, since it has partially removed the preprocessor symbol in lieu of support for a dynamic solution which implements the switchable profile feature of Digital Master.
There's zero reason to have six different versions of this code. However, it will take a bit of care to consolidate those copies into a single, usable and stable version.