View Issue Details

IDProjectCategoryView StatusLast Update
0037756FPCCompilerpublic2020-09-22 09:29
ReporterWolfgang Helbig Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionwon't fix 
PlatformMacOSOS X 
Product Version3.2.0 
Summary0037756: The modifier Interrupt does not modify a procedure to catch an interrupt.
DescriptionI tried to catch a SIGINT signal with a procedure modified as an interrupt procedure. But it did not catch the signal.
Steps To Reproduce{$ Mode ISO}
program interrupt(input, output);
   var i: integer;

   procedure catch; interrupt;
   begin
      i:=2
   end;
begin
   while i = 0 do ;
   writeln(i);
end.

compile and run the above program and then press ^C. It should be caught by the procedure catch but it isn't.
$ interrupt
^C
$

Instead, it should write 0 on output!


Additional Informationkill -2 doesn't work either! But signal SIGINT is a signal, that can be caught!
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Activities

Florian

2020-09-16 19:26

administrator   ~0125572

The interrupt keyword tells the compiler only that it should generate a stack frame which is suitable for interrupt handler.

Wolfgang Helbig

2020-09-21 17:08

reporter   ~0125729

In GPC-Pascal, I could catch a signal. Is it possible with FPC as well?

Sven Barth

2020-09-21 21:25

manager   ~0125736

You need to use the Signals unit (at least on *nix systems). For further questions please use the mailing lists or the forum.

Wolfgang Helbig

2020-09-22 09:29

reporter   ~0125747

Thanks, and sorry for misusing the bug tracker.

Issue History

Date Modified Username Field Change
2020-09-16 18:54 Wolfgang Helbig New Issue
2020-09-16 19:26 Florian Assigned To => Florian
2020-09-16 19:26 Florian Status new => resolved
2020-09-16 19:26 Florian Resolution open => won't fix
2020-09-16 19:26 Florian FPCTarget => -
2020-09-16 19:26 Florian Note Added: 0125572
2020-09-21 17:08 Wolfgang Helbig Note Added: 0125729
2020-09-21 21:25 Sven Barth Note Added: 0125736
2020-09-22 09:29 Wolfgang Helbig Note Added: 0125747