Skip to content

Fix compilation when FW_QUEUE_REGISTRATION == 0#3746

Merged
LeStarch merged 2 commits intonasa:develfrom
celskeggs:patch-17
Jun 17, 2025
Merged

Fix compilation when FW_QUEUE_REGISTRATION == 0#3746
LeStarch merged 2 commits intonasa:develfrom
celskeggs:patch-17

Conversation

@celskeggs
Copy link
Collaborator

Related Issue(s) n/a
Has Unit Tests (y/n) n
Documentation Included (y/n) n

Change Description

When FW_QUEUE_REGISTRATION is 0, Os::Queue::s_queueRegistry cannot be defined or accessed, because it is not declared in Os/Queue.hpp. It results in a compilation error.

Rationale

F Prime's supported configuration options should not cause the build to fail.

Testing/Review Recommendations

n/a

Future Work

  1. This is another sign that we need a more comprehensive set of regression tests for F Prime's long list of configuration options.
  2. It is not clear to me whether this configuration option is truly necessary. Platforms that care about pruning code and data to this extent should be using Link Time Optimization, which (in my testing) appears to be able to optimize away this code on its own.

namespace Os {

FwSizeType Queue::s_queueCount = 0;
#if FW_QUEUE_REGISTRATION

Check notice

Code scanning / CodeQL

Conditional compilation Note

Use of conditional compilation must be kept to a minimum.
this->m_size = messageSize;
ScopeLock lock(Queue::getStaticMutex());
Queue::s_queueCount++;
#if FW_QUEUE_REGISTRATION

Check notice

Code scanning / CodeQL

Conditional compilation Note

Use of conditional compilation must be kept to a minimum.
@LeStarch LeStarch merged commit 39519ba into nasa:devel Jun 17, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants