8000 Add `__attribute__((noreturn,cold))` for `_mi_assert_fail` · Issue #134586 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}
Add __attribute__((noreturn,cold)) for _mi_assert_fail #134586
Closed
@picnixz

Description

@picnixz

Feature or enhancement

Note

I already have a PR ready in case this is accepted

Proposal:

Because _mi_assert_fail is not marked as a noreturn function, the assertion is not understood by CLion and I have some false positives telling me "this ptr is not NULL" while just above there is mi_assert(ptr != NULL);. To improve IDE's analysis, I suggest to mark _mi_assert_fail with __attribute__((noreturn)) and __THROW for GCC, the same attributes that are put on __assert_fail:

extern void __assert_fail (const char *__assertion, const char *__file,
			   unsigned int __line, const char *__function)
     __THROW __attribute__ ((__noreturn__));

cc @colesbury

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0