You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 2860 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
The Objective Caml compiler, version 3.08+alpha0 (2004-06-22)
Standard library directory: /usr/local/adm/src/caml/lib/ocaml
me donne cet avertissement:
/usr/local/adm/src/caml/bin/ocamlc.opt -warn-error A -g -pp "/usr/local/adm/src/caml/bin/camlp4r -I ." -I . -I /usr/local/adm/src/caml/lib/ocaml/camlp4 -c cstr.ml
Warning: char 1246, Invalid backslash escape in string
Warning: char 1123, Invalid backslash escape in string
Les caractères 1123 et 1246 sont ici:
value char_downcase =
-------------^
et ici
value char_eq (c1 : char) c2 = c1 = c2;
-------------^
Bon, je me demande si je n'ai pas une longue chaîne de plus de 1246
caractères, mais les seules de ce fichier sont:
13 lines matching """ in buffer cstr.ml.
1: (* #load "./schemeids.cmo" )
2: ( #load "./string_ids.cmo" )
3: ( #load "pa_scheme.cmo" *)
17:#load "string_macros.cmo";
34:external length : string -> int = "%string_length";
40: (List.fold_left ^ "Illegal substring "
41: [what; " spec: "; indexes; " in "; module_name; "."; caller; "\n"; s])
43: if start < 0 then fail "start" (string_of_int start)
44: else if end_ > length s then fail "end" (string_of_int end_)
46: fail "start/end" (string_of_int start ^ "/" ^ string_of_int end_)
50:external create : int -> string = "caml_create_string";
51:external unsafe_fill : string -> int -> int -> char -> unit = "caml_fill_string" "noalloc";
61: string -> int -> string -> int -> int -> unit = "caml_blit_string" "noalloc";
Le bug se trouve dans les definitions de upper_string et lower_string.
Comme les chaines en questions sont destinees a repasser dans le lexeur,
il faut les encoder avec String.escaped.
J'ai testé avec http://camlcvs.inria.fr/cgi-bin/cvsweb.cgi/cash/cstr/cstr.ml (ocamlc
-pp "camlp4r" en commentant un #load et définissant à la main 2
fonctions) et je n'obtiens pas ce warning. Si je mets un "\p" quelque
part dans une chaîne, j'obtiens bien le warning avec la bonne
position, en numéro de char.
J'ai tout de même changé pour que le warning apparaisse avec le numéro
de ligne.
Je reste preneur de warnings avec positions fantaisistes: ce sont des
bugs qui pourraient rester du changement des locations de
camlp4.
The Objective Caml compiler, version 3.08+alpha0 (2004-06-22)
Standard library directory: /usr/local/adm/src/caml/lib/ocaml
me donne cet avertissement:
/usr/local/adm/src/caml/bin/ocamlc.opt -warn-error A -g -pp "/usr/local/adm/src/caml/bin/camlp4r -I ." -I . -I /usr/local/adm/src/caml/lib/ocaml/camlp4 -c cstr.ml
Warning: char 1246, Invalid backslash escape in string
Warning: char 1123, Invalid backslash escape in string
Les caractères 1123 et 1246 sont ici:
value char_downcase =
-------------^
et ici
value char_eq (c1 : char) c2 = c1 = c2;
-------------^
Original bug ID: 2860
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
The Objective Caml compiler, version 3.08+alpha0 (2004-06-22)
Standard library directory: /usr/local/adm/src/caml/lib/ocaml
me donne cet avertissement:
/usr/local/adm/src/caml/bin/ocamlc.opt -warn-error A -g -pp "/usr/local/adm/src/caml/bin/camlp4r -I ." -I . -I /usr/local/adm/src/caml/lib/ocaml/camlp4 -c cstr.ml
Warning: char 1246, Invalid backslash escape in string
Warning: char 1123, Invalid backslash escape in string
Les caractères 1123 et 1246 sont ici:
value char_downcase =
-------------^
et ici
value char_eq (c1 : char) c2 = c1 = c2;
-------------^
Bon, je me demande si je n'ai pas une longue chaîne de plus de 1246
caractères, mais les seules de ce fichier sont:
13 lines matching """ in buffer cstr.ml.
1: (* #load "./schemeids.cmo" )
2: ( #load "./string_ids.cmo" )
3: ( #load "pa_scheme.cmo" *)
17:#load "string_macros.cmo";
34:external length : string -> int = "%string_length";
40: (List.fold_left ^ "Illegal substring "
41: [what; " spec: "; indexes; " in "; module_name; "."; caller; "\n"; s])
43: if start < 0 then fail "start" (string_of_int start)
44: else if end_ > length s then fail "end" (string_of_int end_)
46: fail "start/end" (string_of_int start ^ "/" ^ string_of_int end_)
50:external create : int -> string = "caml_create_string";
51:external unsafe_fill : string -> int -> int -> char -> unit = "caml_fill_string" "noalloc";
61: string -> int -> string -> int -> int -> unit = "caml_blit_string" "noalloc";
D'autre part, les seuls backslashs sont:
2 lines matching "\\" in buffer cstr.ml.
40: (List.fold_left ^ "Illegal substring "
41: [what; " spec: "; indexes; " in "; module_name; "."; caller; "\n"; s])
Donc je ne sais pas corriger ce qui provoque l'avertissement.
(Pour tester sur mes sources, prendre la version CVS de Cstr sur
camlcvs: http://camlcvs.inria.fr/cgi-bin/cvsweb.cgi/cash/cstr/)
Bruno.
The text was updated successfully, but these errors were encountered: