Skip to content

Add support for the "check disable" pragma to disable the pointer-primitive check #6239

Closed
@jimgrundy

Description

@jimgrundy

CBMC version: 5.34.0
Operating system: N/A
Exact command line resulting in the issue: cbmc main.c --pointer-primitive-check
What behaviour did you expect:

Running this program, I expect the analysis to pass, exactly as it does if I don't include the "--pointer-primitive-check" on the command line.

int main()
{
  void *p = malloc(1);
  void *q;

#pragma CPROVER check push
#pragma CPROVER check disable "pointer-primitive"
  if (__CPROVER_same_object(p,q)) {
  } else {
  }
#pragma CPROVER check pop
}

What happened instead:

CBMC version 5.34.0 (cbmc-5.34.0-dirty) 64-bit x86_64 macos
Parsing main.c
file main.c line 4 function main: Unsupported #pragma CPROVER before ' '
file main.c line 4 function main: syntax error before ' '
PARSING ERROR

Note: this is the same output you get if you use a complete random string in the pragma, say "dog" instead of "pointer-primtive". However, some other check names, like "pointer" do work.

This request has 2 parts:
1/ Support pointer-primitive in this pragma so that it can be disabled for code regions.
2/ Give a better error message that includes the string that wasn't recognized instead of ''

Metadata

Metadata

Assignees

No one assigned

    Labels

    awsBugs or features of importance to AWS CBMC usersaws-mediumbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions