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] Unable to ensure null


  • Subject: [Frama-c-discuss] Unable to ensure null
  • From: dmentre at linux-france.org (David MENTRE)
  • Date: Mon, 02 Jun 2014 08:32:56 +0200
  • In-reply-to: <5388AA1E.50506@grammatech.com>
  • References: <5388AA1E.50506@grammatech.com>

Hello,

Le 30/05/2014 17:56, Ian Blissard a ?crit :
> I have come across a situation where I cannot ensure that a pointer will
> be null, and I am unsure what I am doing incorrectly.

You are using the wrong memory model of WP. Using Typed+cast, everything 
is proved.

I used following command line:
  frama-c -pp-annot -cpp-command="gcc -nostdinc -C -E -I. -I`frama-c 
-print-share-path`/libc" -wp -wp-rte -wp-model Typed+cast null_pointer.c

Two points still unclear to me:
  * Why is this memory model working? I don't know. WP documentation 
should help you.

  * There is still a warning and I don't know if it is dangerous or not:
"""
null_pointer.c:12:[wp] warning: Cast with incompatible pointers types 
(source: sint8*) (target: sint32*)
null_pointer.c:15:[wp] warning: Cast with incompatible pointers types 
(source: sint8*) (target: sint32*)
"""

Best regards,
david