Skip to content

Clarify assertion semantics, SIMICS-23401#415

Merged
mandolaerik merged 1 commit intointel:mainfrom
mandolaerik:pr/clarify-assertion-semantics-simics-23401
Feb 18, 2026
Merged

Clarify assertion semantics, SIMICS-23401#415
mandolaerik merged 1 commit intointel:mainfrom
mandolaerik:pr/clarify-assertion-semantics-simics-23401

Conversation

@mandolaerik
Copy link
Contributor

No description provided.

@syssimics
Copy link
Contributor

PR Verification: ✅ success


> [!NOTE]
>
> Unlike standard assertions in C/C++, DML guarantees that the assertion
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that I think about it, this could be a source of confusion in of itself, because I don't think the Simics API's family of assert macros like ASSERT, FATAL_ERROR_IF, etc. can get optimized out. In particular, both ASSERT and FATAL_ERROR unconditionally resolves to assert_error and fatal_error respectively, whose definitions get linked in so they can't be studied by the compiler, and their signatures are annotated only as noreturn which does not signify "it's undefined behavior to call this function" so GCC can't elide the call.

Hence, this comment can only concern the C standard library's assert.h's assert. It's worth clarifying this:

Unlike assert offered by the C/C++ standard library, and like the ASSERT family of macros offered by the Simics API, DML guarantees...

@mandolaerik mandolaerik force-pushed the pr/clarify-assertion-semantics-simics-23401 branch from 4c98169 to 9d320d1 Compare February 17, 2026 18:37
@syssimics
Copy link
Contributor

PR Verification: ✅ success

@mandolaerik mandolaerik merged commit 4568556 into intel:main Feb 18, 2026
@mandolaerik mandolaerik deleted the pr/clarify-assertion-semantics-simics-23401 branch February 18, 2026 13:43
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

Comments