Nvfortran bug or simply compiler-dependent behavior

This is first a question. The attached example contains an example from our testsuite, where a syntax is constructed and the lexed, and the output compared to a reference output. Nvfortran’s output deviates in the whitespace details (compare err-out/parse_1.out with ref-out/parse_1.ref). I am not certain this is really a bug of nvfortran, or compiler-dependent behavior. Gfortran, NAG, Intel (ifort and ifx) all agree with the reference output.
whitespace_prob.tar.gz (39.1 KB)

Hi Juergen,

While I’ve forgotten the details, I believe this is dependent on the I/O system with UNIX using just a line-feed (ASCII 10), older MACs using carriage return (ASCII 13), and Windows using both CR+LF.

Is there a reason why you’re using Windows CR+LF?

My guess is the other compilers are ignoring CR while we print it and hence the difference.

If I change your code to just use LF (i.e. UNIX), then the test passes.

  ! character(*), parameter, public :: WHITESPACE_CHARS = BLANK// TAB // CR // LF
  character(*), parameter, public :: WHITESPACE_CHARS = BLANK// TAB // LF

-Mat