Replace @ocaml.warnerror by @ocaml.warning in Str#695
Replace @ocaml.warnerror by @ocaml.warning in Str#695lefessan wants to merge 1 commit intoocaml:trunkfrom
Conversation
b6234d3 to
203a03b
Compare
|
I don't remember any discussion on that, but I guess the previous behavior is a reminder that something is fishy with this code and deserve further discussion. E.g. some people suggested to switch to ASCII versions of the function. This changes the behavior of functions, so this cannot be done lightly, but at least the (non-fatal) warnings are a reminder for that. |
You mean like in http://caml.inria.fr/mantis/view.php?id=6694 ? |
|
I opened a similar PR #581 and recently updated so that it is similar to the other functions relying on uppercase/lowercase functions by adding ascii versions and adding a deprecation warning on the original ones. |
|
The reason I haven't changed this part of Str yet is that I'm torn between doing the right thing and being consistent with the choices already made in Char and String. The right thing, in my opinion, is to switch all the library functions that deal with character case from Latin-1 to ASCII, keeping the function names and documenting the change. I was overruled there, so we now have |
Given that I'm now spending my time silencing these warnings in various projects (to be able to support pre 4.03 compiler), I think that this would have been a better approach; but then I personally have never been using this on |
|
I have the same opinion as Xavier, and I don't think so many people rely on the current behavior on Latin-1, or they should be able to adapt quite easily (the default functions should become ASCII, while we should have provided helping functions So, is this discussion going to be settled before the release, or should we keep the warnings for the release, or should we hide them in the release branch ? |
|
If we change(d) the behavior of String.lowercase/uppercase, could we imagine ways to let people know when they were likely to depend on the previous behavior? One could for instance report a runtime warning (with the same OCAMLRUNPARAM flag as for non-closed file-descriptors for instance) when String.lowercase/uppercase would return a different result with the old and new semantics and the string is not a well-formed UTF-8 string. (The probability that a piece of non-ASCII Latin-1 text is valid UTF-8 is very small.) |
|
I think at the moment there is no way around the |
|
A solution would be to keep the _ascii functions after changing the behavior of the standard functions (both functions would have the same semantics), while adding _latin1 functions. This way, most applications would not suffer any problem (no need to deprecate _ascii functions immediately...). |
|
Since there are other PRs on the same subject, and it is more a reminder than anything else, closing. |
Improve systhreads's diff with trunk
ce76e02 flambda-backend: Bugfix for type_application (ocaml#746) 44f3afb flambda-backend: PR580 for main branch (ocaml#743) b851eaa flambda-backend: Backport first part of ocaml/ocaml PR10498 (ocaml#737) fafb4bd flambda-backend: Fix return mode for eta-expanded function in type_argument (ocaml#735) c31f6c3 flambda-backend: Fix treatment of functions called [@nontail] (ocaml#725) 847781e flambda-backend: Fix build_upstream post-PR703 (ocaml#712) bfcbbf8 flambda-backend: Extend Pblock value kind to handle variants (ocaml#703) b2cab95 flambda-backend: Merge ocaml-jst a6d6e0e flambda-backend: Merge ocaml-jst 88a4f63 flambda-backend: Use Pmakearray for immutable arrays (ocaml#699) eeaa44b flambda-backend: Install an ocamldoc binary (ocaml#695) 48d322b flambda-backend: Ensure that GC is not invoked from bounds check failures (ocaml#681) 4370fa1 flambda-backend: Review changes of term directory (ocaml#602) 65a4566 flambda-backend: Add code coverage using bisect_ppx (ocaml#352) 63ab65f flambda-backend: Bugfix for primitive inclusion (ocaml#662) 7e3e0c8 flambda-backend: Fix inclusion checks for primitives (ocaml#661) 96c68f9 flambda-backend: Speed up linking by changing cmxa format (ocaml#607) 1829150 flambda-backend: Bugfix for Translmod.all_idents (ocaml#659) git-subtree-dir: ocaml git-subtree-split: ce76e02
This PR fixes the warnings in
Str(use ofChar.lowercase) by replacing the@ocaml.warnerrorby an@ocaml.warningannotation. The reason for the use of@ocaml.warnerrorin the first place instead of@ocaml.warningmight have been discussed somewhere, but I probably missed that discussion. That's the problem with the current process, i.e. having long discussions on Github, but almost no comments in the code, the result is that we lose a lot of valuable information, unless we find a way to go from a commit number ingit blameto the corresponding PR discussion on Github, probably archived somewhere else for perennity.