Local Labels

When the GCC extensions setting is on, the compiler allows labels limited to a block's scope. A label declared with the __label__ keyword is visible only within the scope of its enclosing block. The following listing shows an example.

Listing: Example of using Local Labels
void f(int i)
{

  if (i >= 0)

  {

    __label__ again; /* First again. */

    if (--i > 0)

      goto again; /* Jumps to first again. */

  }

  else

  {

    __label__ again; /* Second again. */

    if (++i < 0)

      goto again; /* Jumps to second again. */

  }

}