0

I am looking at a C program from 1986 (ESPRESSO by R. Rudell). The function espresso begins as follows:

pcover espresso(F, D1, R)
pcover F, D1, R;
{
    pcover E, D, Fsave;
    pset last, p;
    cost_t cost, best_cost;

begin:
    Fsave = ...
    ...
...
}

What's the meaning of begin? I've never seen it before. Vim highlights it as a keyword.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
RayaneCTX
  • 573
  • 4
  • 13
  • 6
    It's a label, not a keyword. Somewhere else in the same function should be a statement `goto begin;` (possibly several of them). If there isn't, the label is pointless. I note that the function is defined using the K&R (pre-C90 standard) notation. You should not be using such function definitions yourself. However, if the book is from 1986, it is 100% excused; the standard was not available until 1989 at earliest. Be cautious though — pre-standard C is a rough, wild countryside, and the book will probably espouse techniques that are no longer a good idea. – Jonathan Leffler Mar 05 '19 at 01:29
  • 2
    See also [GOTO still considered harmful?](https://stackoverflow.com/questions/46586/goto-still-considered-harmful) for a discussion from the early days of SO. There is useful information in amongst the answers. – Jonathan Leffler Mar 05 '19 at 01:43

0 Answers0