Skip to content

Compile-time Override of Default Assert Hooks#5058

Open
Kronos3 wants to merge 3 commits intonasa:develfrom
Kronos3:compile-time-assert
Open

Compile-time Override of Default Assert Hooks#5058
Kronos3 wants to merge 3 commits intonasa:develfrom
Kronos3:compile-time-assert

Conversation

@Kronos3
Copy link
Copy Markdown
Collaborator

@Kronos3 Kronos3 commented Apr 24, 2026

Related Issue(s) #5057
Has Unit Tests (y/n) n
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) y

Change Description

Implements #5057 (assuming it passes CCB, close this otherwise...)

Rationale

See issue. TLDR, for small platform

Testing/Review Recommendations

Future Work

Need to update platforms to point to this default assert implementation.

AI Usage (see policy)

Claude code read the issue and drafted solution. I made some naming changes but in general looks pretty good.

Closes #5057

#define fileIdFs "Assert: \"%s:%" PRI_FwSizeType "\""
#endif

void Fw::defaultPrintAssert(const CHAR* msg) {
(void)fputs("\n", stderr);
}

void Fw::defaultReportAssert(FILE_NAME_ARG file,
FwAssertArgType arg4,
FwAssertArgType arg5,
FwAssertArgType arg6,
CHAR* destBuffer,
Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@thomas-bc thomas-bc added Breaking Changes / Needs Release Notes Need to add instructions in the release notes for updates. CCB PR needs to go through CCB process labels Apr 24, 2026
#include <Fw/Types/format.hpp>
#include <cassert>
#include <cstdio>
#include <cstdlib>
assert(0);
abort();
}

assert(0);
abort();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Changes / Needs Release Notes Need to add instructions in the release notes for updates. CCB PR needs to go through CCB process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile-time override of defaultReportAssert/defaultPrintAssert

3 participants