| Anonymous | Login | Signup for a new account | 2013-05-25 22:50 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0005271 | OCaml | OCaml general | public | 2011-05-20 00:40 | 2012-09-20 16:21 | ||||||
| Reporter | rrolles | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||||
| Status | assigned | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 3.12.0 | ||||||||||
| Target Version | 4.01.0+dev | Fixed in Version | |||||||||
| Summary | 0005271: parsing/Location.prerr_warning is hard-coded to use Format.err_formatter | ||||||||||
| Description | I have embedded a REPL in a third-party application. Things that issue errors are properly printed as errors, i.e.: Characters 28-31: let f = function | 1 -> 0 | "x" -> 1;; Error: This pattern matches values of type string but a pattern was expected which matches values of type int However, things that issue warnings instead give general errors about bad I/O descriptors: Characters -1--1: let f = function | 1 -> 0 | 1 -> 1;; Error: I/O error: Bad file descriptor I tracked down the cause of this behavior to parsing/location.ml, in the function prerr_warning: open Format let prerr_warning loc w = print_warning loc err_formatter w;; For my purposes, I was able to change err_formatter to std_formatter, and I obtain the proper compiler warnings in my toplevel. In general, it would be nice if the source was changed upstream somehow such that such warnings were redirected into the functions I had registered using Format.set_formatter_output_functions. | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2011-05-20 00:40 | rrolles | New Issue | |
| 2011-05-20 14:30 | doligez | Status | new => assigned |
| 2011-05-20 14:30 | doligez | Assigned To | => doligez |
| 2012-07-10 15:06 | doligez | Target Version | => 4.01.0+dev |
| 2012-07-31 13:36 | doligez | Target Version | 4.01.0+dev => 4.00.1+dev |
| 2012-09-20 16:21 | doligez | Assigned To | doligez => |
| 2012-09-20 16:21 | doligez | Target Version | 4.00.1+dev => 4.01.0+dev |
| Copyright © 2000 - 2011 MantisBT Group |