Skip to content

[CN] Improve error message for bad ordering of ghost arguments in function specifications #964

@dimecon

Description

@dimecon

For example, currently

int foo(int x)
/*@
  requires
    x + n - n < MAXi32();
    cn_ghost i32 n; true;
  ensures
    return == x + 1i32; 
@*/
{
    return x + 1;
}

gives

return code: 1
tests/cn/ghost_bad_ordering.error.c:5:5: warning: experimental keyword 'cn_ghost' (use of experimental features is discouraged)
    cn_ghost i32 n; true;
    ^~~~~~~~ 
tests/cn/ghost_bad_ordering.error.c:5:5: error: unexpected token after ';' and before 'cn_ghost'
Please add error message for state 1696 to parsers/c/c_parser_error.messages
    cn_ghost i32 n; true;
    ^~~~~~~~ 

rems-project/cn#170 (comment)

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