Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] memset and non-chars

  • Subject: [Frama-c-discuss] memset and non-chars
  • From: kurt at (Kurt Roeckx)
  • Date: Fri, 4 Sep 2015 19:18:03 +0200


I'm trying to use wp with alt-ergo and I'm having problems with
memsets for everything that involves more than chars.  I'm not
sure if this is just with memset or a more general problem, it's
just the first thing I notice.

For instance the following things can be checked:
char a[2]; memset(a, 0, sizeof(a));
struct b { char c[2]; } d; memset(&d, 0, sizeof(d));

But if you change the char to int, it can no longer say it's

In the case with chars, it says it's valid for all values n that
are equal or smaller to the size.  For the case with ints only the
value 0 seems to be valid.

If I instead try to use coq I can get the "char a[2]" working, but
not the struct.

PS: Using char a; memset(&a, 0, sizeof(a)); gives me an assertion
failure.  I seem to ge very good in getting assertion failures.