Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable strict resource ID types with OMIT_DEPRECATED build option #1847

Closed
jphickey opened this issue Aug 19, 2021 · 0 comments · Fixed by #1848 or #1839
Closed

Enable strict resource ID types with OMIT_DEPRECATED build option #1847

jphickey opened this issue Aug 19, 2021 · 0 comments · Fixed by #1848 or #1839
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The build system has an "OMIT_DEPRECATED" option which currently turns off all legacy-compatibility code and switches to only providing the new/preferred methods for any API elements that have been changed in recent versions.

Describe the solution you'd like
As part of the OMIT_DEPRECATED option, we should enable set(MISSION_RESOURCEID_MODE STRICT) mode. This mode uses type-safe definitions for all the different resource types, and prevents users from "crossing" different ID types (tasks, apps, etc) at compile time rather than compiling successfully but not running correctly.

Additional context
CI is already testing with OMIT_DEPRECATED on and off so it seems like a good fit to enable strict resource ID types too, the code will be tested in both backward-compatible mode and preferred/new mode.

This was prompted by having two independent PRs both breaking code by mixing ID with other values (one status code - ID mixup, and one a tableID - CDS ID mixup) in the same merge cycle. This strict build option catches both.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Aug 19, 2021
jphickey added a commit to jphickey/cFE that referenced this issue Aug 19, 2021
When the user specifies the OMIT_DEPRECATED build option, also
enable the strictly-typed resource IDs to catch common coding
errors.
astrogeco added a commit that referenced this issue Aug 20, 2021
Fix #1847, enable strict resource id w/OMIT_DEPRECATED
@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants