diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2015-07-08 10:49:36 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2015-07-08 10:49:36 +0200 |
commit | cbcf2f8950d0ea7208d9c021422946433f90e745 (patch) | |
tree | 26e3c38a61f0162d266aaa8e22c244c778d6930c | |
parent | 2b1c0aa69adafac185dd6c4e460d83517bcc8884 (diff) | |
download | compcert-cbcf2f8950d0ea7208d9c021422946433f90e745.tar.gz compcert-cbcf2f8950d0ea7208d9c021422946433f90e745.zip |
Turn "redefinition with an incompatible type" warning into an error.
Also: improve error message by showing old and new types.
-rw-r--r-- | cparser/Elab.ml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml index d6b79780..5be4c598 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -1805,7 +1805,12 @@ let enter_or_refine_ident local loc env s sto ty = | Some new_ty -> new_ty | None -> - warning loc "redefinition of '%s' with incompatible type" s; ty in + error loc + "redefinition of '%s' with incompatible type.@ \ + Previous type: %a.@ \ + New type: %a" + s Cprint.typ old_ty Cprint.typ ty; + ty in let new_sto = (* The only case not allowed is removing static *) match old_sto,sto with |