From d13f593d16c888172bdacc782963c2e491fb60c3 Mon Sep 17 00:00:00 2001
From: Julien Signoles <julien.signoles@cea.fr>
Date: Thu, 27 Mar 2014 08:54:10 +0100
Subject: [PATCH] [typing] remove spurious warnings on real

---
 src/plugins/e-acsl/doc/Changelog                       |  1 +
 .../tests/e-acsl-runtime/oracle/bts1307.1.res.oracle   |  8 --------
 .../tests/e-acsl-runtime/oracle/bts1307.res.oracle     |  4 ----
 src/plugins/e-acsl/typing.ml                           | 10 ++--------
 4 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/src/plugins/e-acsl/doc/Changelog b/src/plugins/e-acsl/doc/Changelog
index f16e51a4b5f..c39c17dad4d 100644
--- a/src/plugins/e-acsl/doc/Changelog
+++ b/src/plugins/e-acsl/doc/Changelog
@@ -15,6 +15,7 @@
 #   E-ACSL: the Whole E-ACSL plug-in
 ###############################################################################
 
+-  E-ACSL       [2014/03/27] Remove spurious warnings when using type `real`.
 -* E-ACSL       [2014/03/26] Fix bug #1692 about wrong localisation of
 	        some messages.
 -  E-ACSL       [2014/03/26] Remove a spurious warning when an annotated
diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/bts1307.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/bts1307.1.res.oracle
index 4e035d9a764..29bb832ec0d 100644
--- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/bts1307.1.res.oracle
+++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/bts1307.1.res.oracle
@@ -6,16 +6,8 @@
 [kernel] preprocessing with "gcc -C -E -I. -IFRAMAC_SHARE/e-acsl  -DE_ACSL_MACHDEP=x86_32 -IFRAMAC_SHARE/libc FRAMAC_SHARE/e-acsl/memory_model/e_acsl_mmodel.h"
 tests/e-acsl-runtime/bts1307.i:16:[kernel] warning: Floating-point constant 0.4 is not represented exactly. Will use 0x1.999999999999ap-2. See documentation for option -warn-decimal-float
 [e-acsl] beginning translation.
-tests/e-acsl-runtime/bts1307.i:13:[e-acsl] warning: approximating type `real' by `long double'
-tests/e-acsl-runtime/bts1307.i:13:[e-acsl] warning: approximating type `real' by `long double'
-tests/e-acsl-runtime/bts1307.i:13:[e-acsl] warning: approximating type `real' by `long double'
-tests/e-acsl-runtime/bts1307.i:13:[e-acsl] warning: approximating type `real' by `long double'
-tests/e-acsl-runtime/bts1307.i:13:[e-acsl] warning: approximating type `real' by `long double'
 tests/e-acsl-runtime/bts1307.i:13:[e-acsl] warning: approximating a real number by a float
-tests/e-acsl-runtime/bts1307.i:25:[e-acsl] warning: approximating type `real' by `long double'
-tests/e-acsl-runtime/bts1307.i:25:[e-acsl] warning: approximating type `real' by `long double'
 tests/e-acsl-runtime/bts1307.i:25:[e-acsl] warning: approximating a real number by a float
-tests/e-acsl-runtime/bts1307.i:25:[e-acsl] warning: approximating type `real' by `long double'
 tests/e-acsl-runtime/bts1307.i:25:[e-acsl] warning: approximating a real number by a float
 [e-acsl] translation done in project "e-acsl".
 [value] Analyzing a complete application starting at main
diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/bts1307.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/bts1307.res.oracle
index e67c07e6cc1..464bfd42cf6 100644
--- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/bts1307.res.oracle
+++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/bts1307.res.oracle
@@ -6,12 +6,8 @@
 [kernel] preprocessing with "gcc -C -E -I. -IFRAMAC_SHARE/e-acsl  -DE_ACSL_MACHDEP=x86_32 -IFRAMAC_SHARE/libc FRAMAC_SHARE/e-acsl/memory_model/e_acsl_mmodel.h"
 tests/e-acsl-runtime/bts1307.i:16:[kernel] warning: Floating-point constant 0.4 is not represented exactly. Will use 0x1.999999999999ap-2. See documentation for option -warn-decimal-float
 [e-acsl] beginning translation.
-tests/e-acsl-runtime/bts1307.i:13:[e-acsl] warning: approximating type `real' by `long double'
-tests/e-acsl-runtime/bts1307.i:13:[e-acsl] warning: approximating type `real' by `long double'
 tests/e-acsl-runtime/bts1307.i:13:[e-acsl] warning: approximating a real number by a float
-tests/e-acsl-runtime/bts1307.i:25:[e-acsl] warning: approximating type `real' by `long double'
 tests/e-acsl-runtime/bts1307.i:25:[e-acsl] warning: approximating a real number by a float
-tests/e-acsl-runtime/bts1307.i:25:[e-acsl] warning: approximating type `real' by `long double'
 tests/e-acsl-runtime/bts1307.i:25:[e-acsl] warning: approximating a real number by a float
 [e-acsl] translation done in project "e-acsl".
 [value] Analyzing a complete application starting at main
diff --git a/src/plugins/e-acsl/typing.ml b/src/plugins/e-acsl/typing.ml
index a1a41887cdc..615d30efd7e 100644
--- a/src/plugins/e-acsl/typing.ml
+++ b/src/plugins/e-acsl/typing.ml
@@ -76,10 +76,7 @@ let typ_of_eacsl_typ = function
   | No_integral (Ltype _) -> Error.not_yet "typing of user-defined logic type"
   | No_integral (Lvar _) -> Error.not_yet "type variable"
   | No_integral Linteger -> Mpz.t ()
-  | No_integral Lreal -> 
-    Options.warning ~current:true ~once:true
-      "approximating type `real' by `long double'"; 
-    TFloat(FLongDouble, [])
+  | No_integral Lreal -> TFloat(FLongDouble, [])
   | No_integral (Larrow _) -> Error.not_yet "functional type"
 
 let eacsl_typ_of_typ ty = 
@@ -173,10 +170,7 @@ let generic_typ (which: < f: 'a. 'a * 'a -> 'a >) t =
 	| Ltype _ as ty when Logic_const.is_boolean_type ty -> Mpz.t ()
 	| Ltype _ -> Error.not_yet "typing of user-defined logic type"
 	| Lvar _ -> Error.not_yet "type variable"
-	| Lreal -> 
-	  Options.warning ~current:true ~once:true
-	    "approximating type `real' by `long double'"; 
-	  TFloat(FLongDouble, [])
+	| Lreal -> TFloat(FLongDouble, [])
 	| Larrow _ -> Error.not_yet "functional type"
       in
       which#f (ty, ty)
-- 
GitLab