[fpc-pascal] Label

Rainer Stratmann RainerStratmann at t-online.de
Thu Aug 9 17:08:41 CEST 2012

Am Thursday 09 August 2012 16:52:40 schrieb Jonas Maebe:
> Sven Barth wrote on Thu, 09 Aug 2012:
> > Am 09.08.2012 15:35, schrieb Jonas Maebe:
> >> Rainer Stratmann wrote on Thu, 09 Aug 2012:
> >>> Is it possible to get the adress of a label in a procedure?
> >>
> >> Not outside that procedure, no.
> >
> > Just because it sounds that way: is it possible inside the procedure?
> Yes, if the label declaration is also inside the procedure. You can
> only take the address of a globally declared label iff
> a) the label is also defined in the global scope ("begin .. end.",
> initialization, finalization)
> b) the label's address is also taken in one of those blocks. It
> doesn't have to be the same one though, because the compiler keeps the
> code for all of those blocks in memory at the same time and hence a
> label defined in one of those is still valid while generating the code
> for another one. That's more a compiler implementation aspect than a
> conscious design decision though

If you have a label in a procedure and declare this procedure as inline 
procedure then it gives also problems (Fatal: compilation aborted!).

More information about the fpc-pascal mailing list