Commit 2874257c authored by POGODALLA Sylvain's avatar POGODALLA Sylvain

Changing warnings raising message and adapting ./configure to support...

Changing warnings raising message and adapting ./configure to support compilation without considering warnings as errors
parent 033e0ec8
......@@ -27,7 +27,7 @@ end
# form parse a:o;
-> 2 analyses.
+ [ ] Bug: analyse d'une constante image d'une constante lève une exception:
+ [X] Bug: analyse d'une constante image d'une constante lève une exception:
signature trees =
tree:type;
......@@ -57,11 +57,13 @@ end
acg-data directory)
+ [X] améliorer le pretty-printing des termes
+ [X] ajouter dépendence à ocf
+ [ ] ajouter dépendence à Ocaml 4.02.1 ? (requis par ocf)
+ [X] ajouter dépendence à Ocaml 4.02.1 ? (requis par ocf)
+ [ ] ajouter parsing de types non atomiques
+ [ ] ajouter détection de nbre infini de solutions
+ [ ] permettre à ./acg de charger des fichiers .acgo
+ [ ] OPAM: enlever les warnings qui deviennent des erreurs
+ [ ] utiliser UF avec tableaux destructifs, et tester l'amélioration des performances
+ [ ] autoriser l'utilisation de symboles non fonctionnels
** DONE Faire un Bolt package
......
......@@ -161,6 +161,22 @@ else
fi
AC_MSG_RESULT(Bolt log level is $BOLT_LEVEL.)
AC_ARG_ENABLE(
[warning-as-errors],
[AS_HELP_STRING([--disable-warning-as-errors], [Disable dealing with compilation warnings as errors])],
[with_log=$enableval],
[with_log=no])
if test "$with_log" = "no" ; then
AC_SUBST(WARNINGS_AS_ERRORS,yes)
else
AC_SUBST(WARNINGS_AS_ERRORS,no)
fi
case "$WARNINGS_AS_ERRORS" in
yes) AC_MSG_RESULT(Compilation warnings considered as errors.);;
*) AC_MSG_RESULT(Compilation warnings not considered as errors.);;
esac
# Look for ANSITerminal with ocamlfind
AC_ARG_VAR(ANSITerminal_PATH,[Directory where to find the ANSITerminal library if not in a standard location])
......@@ -242,7 +258,7 @@ fi
# check if the -w yz option is present
# and set the _loc variable of campl4 to loc
if ($OCAML $ML_CHECK_FILE -ref 3.09 $OCAML_VERSION > /dev/null) ; then
OCAML09WARNINGS="-w yz"
OCAML09WARNINGS="-w z"
OCAMLP4_LOC="-loc loc"
AC_MSG_RESULT($OCAMLP4 calls will be done with the $OCAMLP4_LOC option)
else
......
......@@ -591,16 +591,17 @@ OCAMLP4_LOC
OCAML09WARNINGS
TYPES
CAMLP4_LIB
EASY_FORMAT_PATH
BINIOU_INCLUDE
BINIOU_PATH
YOJSON_PATH
OCF_INCLUDE
OCF_PATH
YOJSON_PATH
BINIOU_INCLUDE
BINIOU_PATH
EASY_FORMAT_PATH
OCamlCairo2_INCLUDE
OCamlCairo2_PATH
ANSITerminal_INCLUDE
ANSITerminal_PATH
WARNINGS_AS_ERRORS
BOLT_LEVEL
BOLT_PP
BOLT_LIB
......@@ -667,6 +668,7 @@ ac_user_opts='
enable_option_checking
enable_kaputt
enable_log
enable_warning_as_errors
'
ac_precious_vars='build_alias
host_alias
......@@ -676,10 +678,10 @@ DYPGENLIB_PATH
BOLTLIB_PATH
ANSITerminal_PATH
OCamlCairo2_PATH
OCF_PATH
YOJSON_PATH
EASY_FORMAT_PATH
BINIOU_PATH
EASY_FORMAT_PATH'
YOJSON_PATH
OCF_PATH'
# Initialize some variables set by options.
......@@ -1302,6 +1304,8 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-kaputt Compile with kaputt for unit testing
--enable-log Enable log information to be produced by bolt
--disable-warning-as-errors
Disable dealing with compilation warnings as errors
Some influential environment variables:
DYPGEN_PATH Directory where to find dypgen if not in a standard location
......@@ -1317,14 +1321,14 @@ Some influential environment variables:
OCamlCairo2_PATH
Directory where to find the OCaml Cairo bindings if not in a
standard location
OCF_PATH Directory where to find the ocf library if not in a standard
location
YOJSON_PATH Directory where to find the Yojson library if not in a standard
EASY_FORMAT_PATH
Directory where to find the Yojson library if not in a standard
location
BINIOU_PATH Directory where to find the biniou library if not in a standard
location
EASY_FORMAT_PATH
Directory where to find the Yojson library if not in a standard
YOJSON_PATH Directory where to find the Yojson library if not in a standard
location
OCF_PATH Directory where to find the ocf library if not in a standard
location
Use these variables to override the choices made by `configure' or to help
......@@ -2902,6 +2906,28 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Bolt log level is $BOLT_LEVEL." >&5
$as_echo "Bolt log level is $BOLT_LEVEL." >&6; }
# Check whether --enable-warning-as-errors was given.
if test "${enable_warning_as_errors+set}" = set; then :
enableval=$enable_warning_as_errors; with_log=$enableval
else
with_log=no
fi
if test "$with_log" = "no" ; then
WARNINGS_AS_ERRORS=yes
else
WARNINGS_AS_ERRORS=no
fi
case "$WARNINGS_AS_ERRORS" in
yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Compilation warnings considered as errors." >&5
$as_echo "Compilation warnings considered as errors." >&6; };;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Compilation warnings not considered as errors." >&5
$as_echo "Compilation warnings not considered as errors." >&6; };;
esac
# Look for ANSITerminal with ocamlfind
......@@ -3246,21 +3272,21 @@ if test "$FOUND_LIB" != "no" ; then
fi
# Look for ocf with ocamlfind
# Look for Easy-format with ocamlfind
MACRO="A"
MACRO=$MACRO"C_LIB_CHECKING"
NAME=ocf
STD_FOLDER=ocf
LIB_FILE=ocf
OFIND_NAME=ocf
OPAM_PACKAGE=ocf
MOD=Ocf
NAME=Easy-format
STD_FOLDER=easy-format
LIB_FILE=easy_format
OFIND_NAME=easy-format
OPAM_PACKAGE=easy-format
MOD=Easy_format
OPTIONS=""
NO_OPTIONAL=true
LIB_PATH=$OCF_PATH
LIB_PATH=$EASY_FORMAT_PATH
# test au cas ou un argument obligatoire est manquant
if test "$NAME" = "" || test "$STD_FOLDER" = "" || test "$OFIND_NAME" = "" || test "$LIB_FILE" = "" || test "$MOD" = "" ; then
......@@ -3290,7 +3316,7 @@ $as_echo_n "checking for optional library : $NAME... " >&6; }
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Cannot remove c_check_ocf.ml. Please change its right with chmod 666 c_check_ocf.ml
as_fn_error $? "Cannot remove c_check_easy-format.ml. Please change its right with chmod 666 c_check_easy-format.ml
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
......@@ -3413,25 +3439,25 @@ $as_echo "The $NAME library is missing." >&6; }
if test "$FOUND_LIB" != "no" ; then
OCF_INCLUDE=$LIB_INCLUDE
EASY_FORMAT_PATH=$LIB_PATH
fi
# Look for Yojson with ocamlfind
# Look for biniou with ocamlfind
MACRO="A"
MACRO=$MACRO"C_LIB_CHECKING"
NAME=Yojson
STD_FOLDER=yojson
LIB_FILE=yojson
OFIND_NAME=yojson
OPAM_PACKAGE=yojson
MOD=Yojson
NAME=Biniou
STD_FOLDER=biniou
LIB_FILE=biniou
OFIND_NAME=biniou
OPAM_PACKAGE=biniou
MOD=Bi_io
OPTIONS=""
NO_OPTIONAL=true
LIB_PATH=$YOJSON_PATH
LIB_PATH=$BINIOU_PATH
# test au cas ou un argument obligatoire est manquant
if test "$NAME" = "" || test "$STD_FOLDER" = "" || test "$OFIND_NAME" = "" || test "$LIB_FILE" = "" || test "$MOD" = "" ; then
......@@ -3461,7 +3487,7 @@ $as_echo_n "checking for optional library : $NAME... " >&6; }
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Cannot remove c_check_yojson.ml. Please change its right with chmod 666 c_check_yojson.ml
as_fn_error $? "Cannot remove c_check_biniou.ml. Please change its right with chmod 666 c_check_biniou.ml
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
......@@ -3584,25 +3610,25 @@ $as_echo "The $NAME library is missing." >&6; }
if test "$FOUND_LIB" != "no" ; then
YOJSON_PATH=$LIB_PATH
BINIOU_INCLUDE=$LIB_INCLUDE
fi
# Look for biniou with ocamlfind
# Look for Yojson with ocamlfind
MACRO="A"
MACRO=$MACRO"C_LIB_CHECKING"
NAME=Biniou
STD_FOLDER=biniou
LIB_FILE=biniou
OFIND_NAME=biniou
OPAM_PACKAGE=biniou
MOD=Bi_io
NAME=Yojson
STD_FOLDER=yojson
LIB_FILE=yojson
OFIND_NAME=yojson
OPAM_PACKAGE=yojson
MOD=Yojson
OPTIONS=""
NO_OPTIONAL=true
LIB_PATH=$BINIOU_PATH
LIB_PATH=$YOJSON_PATH
# test au cas ou un argument obligatoire est manquant
if test "$NAME" = "" || test "$STD_FOLDER" = "" || test "$OFIND_NAME" = "" || test "$LIB_FILE" = "" || test "$MOD" = "" ; then
......@@ -3632,7 +3658,7 @@ $as_echo_n "checking for optional library : $NAME... " >&6; }
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Cannot remove c_check_biniou.ml. Please change its right with chmod 666 c_check_biniou.ml
as_fn_error $? "Cannot remove c_check_yojson.ml. Please change its right with chmod 666 c_check_yojson.ml
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
......@@ -3755,25 +3781,25 @@ $as_echo "The $NAME library is missing." >&6; }
if test "$FOUND_LIB" != "no" ; then
BINIOU_INCLUDE=$LIB_INCLUDE
YOJSON_PATH=$LIB_PATH
fi
# Look for Easy-format with ocamlfind
# Look for ocf with ocamlfind
MACRO="A"
MACRO=$MACRO"C_LIB_CHECKING"
NAME=Easy-format
STD_FOLDER=easy-format
LIB_FILE=easy_format
OFIND_NAME=easy-format
OPAM_PACKAGE=easy-format
MOD=Easy_format
NAME=ocf
STD_FOLDER=ocf
LIB_FILE=ocf
OFIND_NAME=ocf
OPAM_PACKAGE=ocf
MOD=Ocf
OPTIONS=""
NO_OPTIONAL=true
LIB_PATH=$EASY_FORMAT_PATH
LIB_PATH=$OCF_PATH
# test au cas ou un argument obligatoire est manquant
if test "$NAME" = "" || test "$STD_FOLDER" = "" || test "$OFIND_NAME" = "" || test "$LIB_FILE" = "" || test "$MOD" = "" ; then
......@@ -3803,7 +3829,7 @@ $as_echo_n "checking for optional library : $NAME... " >&6; }
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Cannot remove c_check_easy-format.ml. Please change its right with chmod 666 c_check_easy-format.ml
as_fn_error $? "Cannot remove c_check_ocf.ml. Please change its right with chmod 666 c_check_ocf.ml
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
......@@ -3926,13 +3952,10 @@ $as_echo "The $NAME library is missing." >&6; }
if test "$FOUND_LIB" != "no" ; then
EASY_FORMAT_PATH=$LIB_PATH
OCF_INCLUDE=$LIB_INCLUDE
fi
# What is the OCAML version ?
# we extract Ocaml version number
OCAML_VERSION=`$OCAMLC -version`
......@@ -3991,7 +4014,7 @@ fi
# check if the -w yz option is present
# and set the _loc variable of campl4 to loc
if ($OCAML $ML_CHECK_FILE -ref 3.09 $OCAML_VERSION > /dev/null) ; then
OCAML09WARNINGS="-w yz"
OCAML09WARNINGS="-w z"
OCAMLP4_LOC="-loc loc"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLP4 calls will be done with the $OCAMLP4_LOC option" >&5
$as_echo "$OCAMLP4 calls will be done with the $OCAMLP4_LOC option" >&6; }
......
......@@ -20,8 +20,14 @@
DEBUGFLAG = -g
OCAMLCPOPT = -p fm
# Remove warnings:
# 58: Missing cmx file
DISABLE_WARNINGS=-58
# All warnings are treated as errors
WARNINGS = @OCAML09WARNINGS@ -warn-error A -warn-error -58
WARNINGS = @OCAML09WARNINGS@ -w $(DISABLE_WARNINGS) -warn-error A
COMMONFLAGS= $(WARNINGS) @TYPES@
BYTEFLAGS = $(COMMONFLAGS) $(DEBUGFLAG)
OPTFLAGS = $(COMMONFLAGS)
......
......@@ -64,9 +64,9 @@ struct
(* TODO : Replace by an assert within IFDEFDEBUG *)
try
match Symbols.find sym syms with
| Term_declaration (x,id,_,const_type) as t when sym=x-> Lambda.Const id,const_type
| Term_declaration (x,id,_,const_type) when sym=x-> Lambda.Const id,const_type
| Term_declaration _ -> failwith "Bug in find_term" (* x should match the symbol *)
| Term_definition (x,id,_,const_type,_) as t when sym=x-> Lambda.DConst id,const_type
| Term_definition (x,id,_,const_type,_) when sym=x-> Lambda.DConst id,const_type
| Term_definition _ -> failwith "Bug in find_term" (* x should match the symbol *)
| _ -> failwith "Bug in find_term" (* x should return a Term, not a type *)
with
......@@ -96,7 +96,7 @@ struct
let name {name=n} = n
let find_atomic_type s ({types=syms} as sg) =
let find_atomic_type s {types=syms} =
(* TODO : Replace by an assert within IFDEFDEBUG *)
try
match Symbols.find s syms with
......@@ -380,7 +380,7 @@ struct
let t=typecheck t t_type sg in
t,t_type
let type_of_constant x ({terms=syms} as sg) =
let type_of_constant x {terms=syms} =
try
match Symbols.find x syms with
| Term_declaration (s,_,_,ty) when x = s -> ty
......
......@@ -418,10 +418,10 @@ sig_entries :
term :
| LAMBDA0 idents DOT term {
let sg = get_sig_value dyp.last_local_data in
let _sg = get_sig_value dyp.last_local_data in
fun env ws -> reset_location $1 (multiple_abs env ws Abstract_syntax.Linear $2 $4 (fun x -> x))} binder
| LAMBDA idents DOT term {
let sg = get_sig_value dyp.last_local_data in
let _sg = get_sig_value dyp.last_local_data in
fun env ws -> reset_location $1 (multiple_abs env ws Abstract_syntax.Non_linear $2 $4 (fun x -> x))} binder
| IDENT<b> idents<ids> DOT ...{let sg = get_sig_value dyp.last_local_data in
let binder,((p1,p2) as l) = b in
......@@ -518,7 +518,7 @@ sig_entries :
| exc -> raise exc }
| comma_ids<ids> COLON_EQUAL ...{
let abs,obj = get_abs_and_obj_sig_value dyp.last_local_data in
let kind =
let _kind =
List.fold_left
(fun k (id,loc) ->
match k,fst (Environment.Signature1.is_constant id abs),Environment.Signature1.is_type id abs with
......
......@@ -71,7 +71,7 @@ struct
(try
let ty_in_env=IntMap.find (env.l_level-i-1) env.lvar_typing in
LOG "%sAdding an equation (Lvariable found in the environment) %d<-->%d" prefix ty_var ty_in_env LEVEL TRACE ;
let new_eq=UF.union ty_var (IntMap.find (env.l_level-i-1) env.lvar_typing) env.type_equations in
let new_eq=UF.union ty_var ty_in_env env.type_equations in
ty_var,{env with type_equations=new_eq}
with
| Not_found ->
......
......@@ -537,7 +537,7 @@ struct
let () = Environment.Signature1.type_to_formatted_string Format.str_formatter ty' obj in
let () = Utils.sformat "@]@]@]@." in
let () = if first&&svg_output then
let expanded_t = Lambda.Lambda.normalize (Environment.Signature1.expand_term t abs) in
let _expanded_t = Lambda.Lambda.normalize (Environment.Signature1.expand_term t abs) in
let d = ShowI.realize_diagram t lexicons !config in
(* let d = ShowI.realize_diagram expanded_t lexicons in *)
Diagram.to_svg "realize.svg" d
......@@ -612,7 +612,7 @@ struct
let parse ?name e data l =
let lex = get_lex name "parse" e l in
let abs,obj=Environment.Lexicon.get_sig lex in
(* let abs,_=Environment.Lexicon.get_sig lex in *)
match Data_parser.parse_heterogenous_term ~output:false data lex with
| None -> ()
| Some (obj_t,abs_ty) ->
......@@ -634,7 +634,7 @@ struct
let query ?name e data l =
let lex = get_lex name "idb" e l in
let abs,obj=Environment.Lexicon.get_sig lex in
(* let _,_=Environment.Lexicon.get_sig lex in *)
match Data_parser.parse_heterogenous_term ~output:false data lex with
| None -> ()
| Some (obj_t,abs_ty) ->
......
......@@ -22,7 +22,7 @@ let engine_group =
rendering_option
let engine_group_wrapper =
let default_engine_group = engine_group in
let _default_engine_group = engine_group in
Ocf.Wrapper.make
Ocf.to_json
(fun ?def:g j ->
......
......@@ -242,8 +242,8 @@ module Make (E : Environment_sig)
let realize_diagram (abs_term : term) (lexs : lexicon list) (config : Rendering_config.config) : diagram =
let abs_sig = abstract_sig @@ List.hd lexs in
let obj_sigs = List.map object_sig lexs in
let sigs = abs_sig :: obj_sigs in
(* let obj_sigs = List.map object_sig lexs in *)
(* let _sigs = abs_sig :: obj_sigs in *)
let expanded_abs_term = Lambda.Lambda.normalize (E.Signature1.expand_term abs_term abs_sig) in
let abs_terms_differ = abs_term != expanded_abs_term in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment