Skip to content

Mismatch between line numbers and sourcelines content in JSON when using preprocessed code #52

@waskyo

Description

@waskyo

Sorry for the long title, but the issue is hard to explain succinctly.

If I pass a preprocessed file to chkc, the proof obligation line numbers reference the line numbers in the source before the preprocessor was run, and not the lines in the preprocessed file.

However, filesource -> sourcelines in the json file contains the preprocessed output.

This means that the line numbers between the proof obligations and the source inside of the json don't match.

See attached json file for an example of the issue. Also attached are the original C file and preprocessed C file (renamed to .txt to appease GitHub) that I used to generate the json output.

The commands I ran were:

gcc -E hello.c > hello_preproc.c
chkc c-file run hello_preproc.c --json -o hello_preproc.c

hello_preproc.c.json
hello_preproc.c.txt
hello.c.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions