Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005271OCamlOCaml generalpublic2011-05-20 00:402014-09-26 22:05
Assigned To 
PlatformOSOS Version
Product Version3.12.0 
Target Version4.02.2+devFixed in Version 
Summary0005271: parsing/Location.prerr_warning is hard-coded to use Format.err_formatter
DescriptionI 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/, 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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
rrolles (reporter)
2014-09-26 22:05

I know this bug does not seem very sexy or important given its modest description. However, it not being fixed means that users of my program IDAOCaml (an OCaml REPL for a third-party application) have to modify OCaml and recompile it from scratch. If it was fixed, they could just use the binary distribution. Pretty please?

- 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
2013-06-17 16:00 gasche Target Version 4.01.0+dev => 4.02.0+dev
2013-07-12 18:15 doligez Target Version 4.02.0+dev => 4.01.1+dev
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-08-18 20:44 doligez Target Version 4.02.0+dev => 4.02.1+dev
2014-09-04 00:25 doligez Target Version 4.02.1+dev => undecided
2014-09-26 19:40 doligez Target Version undecided => 4.02.2+dev
2014-09-26 22:05 rrolles Note Added: 0012217

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker