Skip to content

encounter __CPROVER_enforce_requires_is_fresh : function malloc is not declare #8706

@kaichieh0524

Description

@kaichieh0524

Version: CBMC 6.7.1
OS: Ubuntu 24.04

I'm trying to write a harness proof to such function below

#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>

void foo(uint8_t *a)
__CPROVER_requires(__CPROVER_is_fresh(a, sizeof(uint8_t)))
{
   if(!a) return;
   *a = 1;
   return;
}

void harness(void)
{
  uint8_t *a;
  foo(a);
  return;
}

when I run the cbmc, then I got ' __CPROVER_enforce_requires_is_fresh : function malloc is not declare'. How can I fix this issue?

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