[Ada] Make "gcc -gnatDGL" handle unterminated last lines properly

Pierre-Marie de Rodat derodat@adacore.com
Fri Jun 18 08:38:27 GMT 2021


This patch fixes a bug in which "gcc -gnatDGL" raises an unhandled
Constraint_Error in checks-on mode if the last line in the file is not
terminated with a line terminator.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sprint.adb (Write_Source_Line): Check for EOF in
	Line_Terminator loop.  Note that when a source file is read in,
	an EOF character is added to the end.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 547 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210618/7cc2e477/attachment-0001.bin>


More information about the Gcc-patches mailing list