Skip to content

Diagnostics - #292

Open
sipma wants to merge 4 commits into
static-analysis-engineering:masterfrom
sipma:diagnostics
Open

Diagnostics#292
sipma wants to merge 4 commits into
static-analysis-engineering:masterfrom
sipma:diagnostics

Conversation

@sipma

@sipma sipma commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

This PR adds a diagnostic code to error and warning log messages, to enable downstream users to decide what action to take in response to these messages. The diagnostic codes introduced are:

    USERDATA: data provided by the user via user data is
        incorrect or incomplete. This should be fixed by
        the user.

    TYPING: data provided by the user via header files or
        typing information provided in function annotations
        in the userdata is inconsistent or incomplete. This
        can often be fixed by the user.

    UNSUPPORTED: a known gap in analyzer support: an
        unimplemented instruction, expression form, or
        statement kind. Not fixable by the user: the function
        cannot currently be processed; it requires an extension
        to the analyzer.

    INTERNAL: an internal invariant was violated: analysis reached
        a program point without a fact (e.g., a reaching definition,
        or a non-error value) that the surrounding code assumed would
        be present. Not fixable by the user; indicates a possible
        defect in the analyzer rather than a known missing feature,
        and should be fixed by CodeHawk maintainers.

In this PR only about a quarter of the (some 200) messages have been converted so far to report this diagnostic. Over time all error/warning messages will be converted, is the plan.

Furthermore, a new error message (with diagnostic code TYPING) has been added that will be raised whenever a lifting is produced that includes one or more untyped local variables. However, this will only be reported when there are no other errors reported (to reduce the noise).

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.

2 participants