Skip to content

Reading files with "rb" causes issues in Windows #162

@pauloscustodio

Description

@pauloscustodio

In input.cc:18 the .re file is opened in binary mode - fopen (file_name.c_str (), "rb");
This causes a test failures on a git clone of the repository on Windows:

  • code_points_error_esc.re:
    re2c: warning: line 2: column 5: escape has no effect: '' [-Wuseless-escape]

because the back-slash is followed by a '\r' and then a '\n'

  • code_points_error_lf.re
    re2c: error: line 2, column 7: syntax error

column number is 6 is the reference file, result is 7 due to extra '\r'

In git, when a repository is cloned in Windows, all text files get '\r\n' line endings, which are then converted to '\n' on commit. By opening in binary mode in input.cc, the '\r' are not filtered by stdio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions