ROOT 6.14 on Windows and EOL: LF vs CRLF


ROOT Version: 6.14/06
Platform: Windows 10 Enterprise
Compiler: Visual Studio 2017 Community v15.7.6


Hello,

With the official binary package, running a script which ends with LF works fine, e.g. test_curly_lf.cpp (6 Bytes):

$ file /c/URANIE/MacroTests/test_curly_lf.cpp
/c/URANIE/MacroTests/test_curly_lf.cpp: ASCII text
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.6
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>call C:\URANIE\tools\root_v6.14.06.win32.vc15\root\bin\thisroot.bat

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>root -q C:\URANIE\MacroTests\test_curly_lf.cpp
------------------------------------------------------------
| Welcome to ROOT 6.14/06                http://root.cern.ch |
|                               (c) 1995-2018, The ROOT Team |
| Built for win32                                            |
| From tags/v6-14-06@v6-14-06, Nov 05 2018, 10:35:04         |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------


Processing C:\URANIE\MacroTests\test_curly_lf.cpp...

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>echo %ERRORLEVEL%
0

However, I encounter an error if the file ends with CRLF, e.g.
test_curly_crlf.cpp (8 Bytes):

$ file /c/URANIE/MacroTests/test_curly_crlf.cpp
/c/URANIE/MacroTests/test_curly_crlf.cpp: ASCII text, with CRLF line terminators
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>root -q C:\URANIE\MacroTests\test_curly_crlf.cpp
------------------------------------------------------------
| Welcome to ROOT 6.14/06                http://root.cern.ch |
|                               (c) 1995-2018, The ROOT Team |
| Built for win32                                            |
| From tags/v6-14-06@v6-14-06, Nov 05 2018, 10:35:04         |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------


Processing C:\URANIE\MacroTests\test_curly_crlf.cpp...
Assertion failed: content[posOpenCurly] == '{' && "No curly at claimed position of opening curly!", file c:\build\release\buildtype\release\sources\root-6.14.06\interpreter\cling\lib\metaprocessor\metaprocessor.cpp, line 431

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>echo %ERRORLEVEL%
-1073740791

Do you know how to solve this problem?

Best regards

Hi,

I’ll have to check if this is coming from Cling/llvm/Clang. For the time being, just convert your files to LF line ending

Cheers, Bertrand.