News for hackers. Stuff that matters.
Re:Error handling style in C by cube13 on Tuesday April 24, 2012 @01:43PM (#3885272)
I'm actually curious how the compilers would handle this. The compiler may inline the gotos so it's really:

  int init_abc()
  {
      if(!init_a())
          return 0;
      if(!init_b())
          cleanup_a();
          return 0;
      if(!init_c())
          cleanup_a();
          cleanup_b();
          return 0;
      return 1;
  }

There are no comments on this comment yet.