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

SB unreachable code in CFE_SB_AppInit #1669

Open
jphickey opened this issue Jul 15, 2021 · 0 comments
Open

SB unreachable code in CFE_SB_AppInit #1669

jphickey opened this issue Jul 15, 2021 · 0 comments

Comments

@jphickey
Copy link
Contributor

Describe the bug
The following conditional is never reachable with the default config:

if (CFE_PLATFORM_EVS_MAX_EVENT_FILTERS < CfgFileEventsToFilter)
{
CfgFileEventsToFilter = CFE_PLATFORM_EVS_MAX_EVENT_FILTERS;
} /* end if */

To reach this would require that the code is built with a config where CFE_PLATFORM_EVS_MAX_EVENT_FILTERS (from platform config, defaults to 8) is less than CFE_SB_MAX_CFG_FILE_EVENTS_TO_FILTER (hardcoded to 8).

To Reproduce
Build code with default config and run coverage report.

Expected behavior
Code could be cleaned up to not have unreachable lines in any config, or at least convert the check such that it can be evaluated at compile time (if CFE_PLATFORM_EVS_MAX_EVENT_FILTERS >= CFE_SB_MAX_CFG_FILE_EVENTS_TO_FILTER then the code becomes unreachable).

System observed on:
Ubuntu

Additional context
Somewhat related to #1468, if this is fixed hopefully it would get both of these

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@skliper skliper changed the title Unreachable code in CFE_SB_AppInit SB unreachable code in CFE_SB_AppInit Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants