From 399cf541e2abde8053b7ce39650f745c8bab8c44 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 18 Jul 2019 13:18:35 +0100 Subject: [PATCH 07/11] Fix warnings in newer OCaml. File "../libgettext-ocaml/gettextMo.ml", line 259, characters 13-36: 259 | | Failure("lexing: empty token") -> ^^^^^^^^^^^^^^^^^^^^^^^ Warning 52: Code should not depend on the actual values of this constructor's arguments. They are only for information and may change in future versions. (See manual section 9.5) File "../libgettext-ocaml/gettextMo.ml", line 275, characters 15-38: 275 | | Failure("lexing: empty token") -> ^^^^^^^^^^^^^^^^^^^^^^^ Warning 52: Code should not depend on the actual values of this constructor's arguments. They are only for information and may change in future versions. (See manual section 9.5) File "../libgettext-ocaml/gettextMo.ml", line 296, characters 15-38: 296 | | Failure("lexing: empty token") -> ^^^^^^^^^^^^^^^^^^^^^^^ Warning 52: Code should not depend on the actual values of this constructor's arguments. They are only for information and may change in future versions. (See manual section 9.5) File "gettextStub.ml", line 101, characters 28-63: 101 | with Failure("setlocale(invalid localization)") as exc -> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Warning 52: Code should not depend on the actual values of this constructor's arguments. They are only for information and may change in future versions. (See manual section 9.5) --- libgettext-ocaml/gettextMo.ml | 6 +++--- libgettext-stub-ocaml/gettextStub.ml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libgettext-ocaml/gettextMo.ml b/libgettext-ocaml/gettextMo.ml index 246a115..22630d4 100644 --- a/libgettext-ocaml/gettextMo.ml +++ b/libgettext-ocaml/gettextMo.ml @@ -256,7 +256,7 @@ let input_mo_informations failsafe chn mo_header = GettextMo_parser.main GettextMo_lexer.token_field_name lexbuf with Parsing.Parse_error - | Failure("lexing: empty token") -> + | Failure _ -> fail_or_continue failsafe (MoInvalidOptions (lexbuf,empty_translation)) [] @@ -272,7 +272,7 @@ let input_mo_informations failsafe chn mo_header = GettextMo_lexer.token_field_plural_value lexbuf with Parsing.Parse_error - | Failure("lexing: empty token") -> + | Failure _ -> fail_or_continue failsafe (MoInvalidPlurals(lexbuf,field_plural_forms)) @@ -293,7 +293,7 @@ let input_mo_informations failsafe chn mo_header = GettextMo_lexer.token_field_content_type lexbuf with Parsing.Parse_error - | Failure("lexing: empty token") -> + | Failure _ -> fail_or_continue failsafe (MoInvalidContentType(lexbuf,field_content_type)) gettext_content diff --git a/libgettext-stub-ocaml/gettextStub.ml b/libgettext-stub-ocaml/gettextStub.ml index 03ac2a5..dc798a2 100644 --- a/libgettext-stub-ocaml/gettextStub.ml +++ b/libgettext-stub-ocaml/gettextStub.ml @@ -98,7 +98,7 @@ module Native : GettextTypes.REALIZE_TYPE = ( try GettextStubCompat.setlocale GettextStubCompat.LC_ALL language - with Failure("setlocale(invalid localization)") as exc -> + with Failure _ as exc -> let () = fail_or_continue t.failsafe exc () in -- 2.22.0