summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2012-03-07 17:50:17 +0000
committerAlain Frisch <alain@frisch.fr>2012-03-07 17:50:17 +0000
commit1fb4007ece64b1d59e16d7a84639fce1dd69ed45 (patch)
treec1add897f9772ec62f4208cda687f46400a78681
parent864e8554aeef0cb1078a39a4750c02ee8e25b87d (diff)
#5527: absolute filenames for more error messages.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12202 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--asmcomp/asmgen.ml3
-rw-r--r--asmcomp/asmpackager.ml11
-rw-r--r--asmcomp/compilenv.ml9
-rw-r--r--bytecomp/bytelibrarian.ml3
-rw-r--r--bytecomp/bytepackager.ml14
5 files changed, 25 insertions, 15 deletions
diff --git a/asmcomp/asmgen.ml b/asmcomp/asmgen.ml
index c14c0006d..5f513db1b 100644
--- a/asmcomp/asmgen.ml
+++ b/asmcomp/asmgen.ml
@@ -135,4 +135,5 @@ let compile_implementation ?toplevel prefixname ppf (size, lam) =
let report_error ppf = function
| Assembler_error file ->
- fprintf ppf "Assembler error, input left in file %s" file
+ fprintf ppf "Assembler error, input left in file %a"
+ Location.print_filename file
diff --git a/asmcomp/asmpackager.ml b/asmcomp/asmpackager.ml
index 548a0a3d5..3f44a0a98 100644
--- a/asmcomp/asmpackager.ml
+++ b/asmcomp/asmpackager.ml
@@ -193,13 +193,14 @@ open Format
let report_error ppf = function
Illegal_renaming(file, id) ->
- fprintf ppf "Wrong file naming: %s@ contains the code for@ %s"
- file id
+ fprintf ppf "Wrong file naming: %a@ contains the code for@ %s"
+ Location.print_filename file id
| Forward_reference(file, ident) ->
- fprintf ppf "Forward reference to %s in file %s" ident file
+ fprintf ppf "Forward reference to %s in file %a" ident
+ Location.print_filename file
| Wrong_for_pack(file, path) ->
- fprintf ppf "File %s@ was not compiled with the `-for-pack %s' option"
- file path
+ fprintf ppf "File %a@ was not compiled with the `-for-pack %s' option"
+ Location.print_filename file path
| File_not_found file ->
fprintf ppf "File %s not found" file
| Assembler_error file ->
diff --git a/asmcomp/compilenv.ml b/asmcomp/compilenv.ml
index 9fe9c94da..4c6e72d0b 100644
--- a/asmcomp/compilenv.ml
+++ b/asmcomp/compilenv.ml
@@ -227,8 +227,11 @@ open Format
let report_error ppf = function
| Not_a_unit_info filename ->
- fprintf ppf "%s@ is not a compilation unit description." filename
+ fprintf ppf "%a@ is not a compilation unit description."
+ Location.print_filename filename
| Corrupted_unit_info filename ->
- fprintf ppf "Corrupted compilation unit description@ %s" filename
+ fprintf ppf "Corrupted compilation unit description@ %a"
+ Location.print_filename filename
| Illegal_renaming(modname, filename) ->
- fprintf ppf "%s@ contains the description for unit@ %s" filename modname
+ fprintf ppf "%a@ contains the description for unit@ %s"
+ Location.print_filename filename modname
diff --git a/bytecomp/bytelibrarian.ml b/bytecomp/bytelibrarian.ml
index cec06e186..21427c844 100644
--- a/bytecomp/bytelibrarian.ml
+++ b/bytecomp/bytelibrarian.ml
@@ -117,4 +117,5 @@ let report_error ppf = function
| File_not_found name ->
fprintf ppf "Cannot find file %s" name
| Not_an_object_file name ->
- fprintf ppf "The file %s is not a bytecode object file" name
+ fprintf ppf "The file %a is not a bytecode object file"
+ Location.print_filename name
diff --git a/bytecomp/bytepackager.ml b/bytecomp/bytepackager.ml
index 759ad46d2..089c5f6dc 100644
--- a/bytecomp/bytepackager.ml
+++ b/bytecomp/bytepackager.ml
@@ -255,13 +255,17 @@ open Format
let report_error ppf = function
Forward_reference(file, ident) ->
- fprintf ppf "Forward reference to %s in file %s" (Ident.name ident) file
+ fprintf ppf "Forward reference to %s in file %a" (Ident.name ident)
+ Location.print_filename file
| Multiple_definition(file, ident) ->
- fprintf ppf "File %s redefines %s" file (Ident.name ident)
+ fprintf ppf "File %a redefines %s"
+ Location.print_filename file
+ (Ident.name ident)
| Not_an_object_file file ->
- fprintf ppf "%s is not a bytecode object file" file
+ fprintf ppf "%a is not a bytecode object file"
+ Location.print_filename file
| Illegal_renaming(file, id) ->
- fprintf ppf "Wrong file naming: %s@ contains the code for@ %s"
- file id
+ fprintf ppf "Wrong file naming: %a@ contains the code for@ %s"
+ Location.print_filename file id
| File_not_found file ->
fprintf ppf "File %s not found" file