-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Take the following program:
#include <stdlib.h> /* malloc */
void foo()
//@ requires true;
//@ ensures true;
{
unsigned int count = 3;
malloc(sizeof(unsigned char) * count);
}
After applying my patch in #28 and running VeriFast, i get the error:
foo.c(8,34-39): Type mismatch. Actual: uintptr_t. Expected: int.
The IDE highlights count as the source of the type error. I don't know where the int expectation is coming from.
I don't understand why, if I pull out the expression into its own variable, VeriFast passes:
#include <stdlib.h> /* malloc */
#include <stddef.h> /* size_t */
void foo()
//@ requires true;
//@ ensures true;
{
unsigned int count = 3;
size_t size = sizeof(unsigned char) * count;
malloc(size);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels