GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/algol68

Algol68: Open source files in binary mode

The Algol68 compiler now opens source files in binary mode, fixing issues with CRLF newlines on Windows.

The Algol68 compiler now opens source files in binary mode to prevent incorrect handling of CRLF newlines on Windows. Without this change, CRLF sequences were being converted to LFs, causing a86_file_read to return incorrect byte counts and trigger assertions.

In Details

This change addresses an issue in the Algol68 frontend related to reading source files on Windows. Specifically, the Windows newline convention (CRLF) was interfering with a86_file_read, leading to short byte counts and assertion failures. Opening the files in binary mode resolves this issue by preventing the conversion of CRLF to LF.

For Context

When a compiler reads source code, it needs to handle different ways of representing the end of a line. Windows uses a combination of two characters (CRLF) while other systems like Linux use just one (LF). This commit changes how the Algol68 compiler opens source files. It now opens them in 'binary mode', which tells the system to read the file exactly as it is, without trying to interpret or change the newline characters. This ensures that the compiler reads the correct number of bytes and avoids errors when compiling Algol68 code on Windows.

Filed Under: algol68windowsnewlinefile I/O