https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70786
Bug ID: 70786
Summary: Missing "not" breaks Ada.Text_IO.Get_Immediate(File,
Item, Available)
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: ktamp at chem dot uoa.gr
Target Milestone: ---
OS: Arch Linux x64
GCC version: 5.3.0
Missing "not" in line #671 of a-textio.adb causes Get_Immediate(File, Item,
Available) to throw an exception when key "[" is pressed. This also affects
processing of keypresses when function keys F5 to F12 are pressed.
Get_Immediate(File, Item) does not have the same issue because "not" is there
(line #611): "(if not Is_Start_Of_Encoding (Character'Val (ch),
File.WC_Method)"
Example code (run and press e.g. key F12):
with Ada.Text_IO; use Ada.Text_IO;
procedure Test is
C : Character;
Available : Boolean;
begin
Get_Immediate (C);
loop
Put (Integer'Image (Character'Pos (C)));
Get_Immediate (C, Available);
exit when not Available;
end loop;
end Test;