Fix mismatched header guard in todimpl.h coverage stub - #490
Open
camdenconrad wants to merge 1 commit into
Open
Conversation
The include guard used #ifndef OVERRIDE_TOOIMPL_H but #define OVERRIDE_TODIMPL_H, so the guard macro was never actually defined and the header was not protected against double inclusion. Correct the #ifndef to OVERRIDE_TODIMPL_H to match the #define and the file name, consistent with the other override stubs (e.g. OVERRIDE_THREADIMPL_H). This also resolves a -Werror=header-guard build failure on newer GCC. Signed-off-by: Camden Conrad <camdenconrad1@gmail.com>
camdenconrad
force-pushed
the
fix-todimpl-header-guard-typo
branch
from
July 13, 2026 14:32
6288d96 to
cc8f3e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #491
Describe the contribution
The coverage stub
unit-test-coverage/ut-stubs/override_inc/rtems/score/todimpl.hhas a mismatched include guard. The#ifndefchecksOVERRIDE_TOOIMPL_H, but the#definesetsOVERRIDE_TODIMPL_H. Because the two names differ, the guard macro is never actually defined when the guard is evaluated, so the header is not protected against double inclusion.This corrects the
#ifndeftoOVERRIDE_TODIMPL_Hso it matches the#defineand the file name, consistent with the other override stubs in this directory (for exampleOVERRIDE_THREADIMPL_Hinthreadimpl.h).No functional or behavioral change is intended; this only repairs the include guard.
Testing performed
Built the
native_stdconfiguration (cFE, OSAL, PSP, and the sample apps) and confirmed the tree compiles and CFE boots to the OPERATIONAL state. The mismatch is also flagged by newer compilers under-Wheader-guard; with-Werrorenabled this caused a build failure that is resolved by this change.Expected behavior changes
None. The include guard now functions as intended.
System(s) tested on
dev, PSP at the pinned submodule commitAdditional context
The mismatch surfaces as a hard error only on compilers that enable
-Wheader-guard(such as recent GCC) when built with-Werror. On older compilers it is silent, which is likely why it has gone unnoticed.Contributor Info
Camden Conrad (@camdenconrad)