Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings emitted by the compiler may contain \r\r\n on Windows #7106

vicuna opened this Issue Dec 23, 2015 · 2 comments


None yet
1 participant
Copy link

vicuna commented Dec 23, 2015

Original bug ID: 7106
Reporter: @dra27
Status: closed (set by @damiendoligez on 2016-01-27T14:42:39Z)
Resolution: fixed
Priority: normal
Severity: tweak
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: platform support (windows, cross-compilation, etc)

Bug description

The text of certain warnings (e.g. from the @@@ocaml.deprecated attribute) may contain newline characters copied directly from the source file. If the source file has Windows line-endings, these will be preserved as \r\n.

The default formatters for displaying warnings in the compiler have text translation enabled which means that the \n characters are mapped to \r\n resulting in \r\r\n being written to the console.

While this makes no visible difference on the console, it is a problem if the output is being recorded (in the testsuite).

Steps to reproduce

On a Windows system, compile OCaml trunk
Then run make within testsuite/tests/warnings and the deprecated_module_use test will fail.
deprecated_module_use.result will contain extra \r characters at the end of lines 3, 4 and 5.

Additional information

Be careful if using a Git clone made before 12 December 2015 that line endings are correct (commit d8b7a4) as Git doesn't automatically correct these. The best course is to create a fresh clone of trunk.


This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Dec 23, 2015

Comment author: @dra27



This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jan 27, 2016

Comment author: @damiendoligez

Fixed in trunk (commit 6e6cabf).

Thanks for the report and patch.

@vicuna vicuna closed this Jan 27, 2016

@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.