Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: EXP12 compliance

...

Code Block
bgColor#ffcccc
void cleanup(void) {
  /* delete temporary files, restore consistent state, etc. */
}

int main(void) {
  if (atexit(cleanup); != 0) {
    /* Handle Error */
  }

  /* ... */

  assert(/* something bad didn't happen */);

  /* ... */
}

...

Code Block
bgColor#ccccff
void cleanup(void) {
  /* delete temporary files, restore consistent state, etc */
}

int main(void) {
  if (atexit(cleanup); != 0) {
    /* Handle Error */
  }

  /* ... */

  if (/* something bad happened */) {
    exit(EXIT_FAILURE);
  }

  /* ... */
}

...