/**
 * Coverity Scan model
 *
 * Manage false positives by giving coverity some hints.
 *
 * Updates to this file must be manually submitted by an admin to:
 *
 *   https://scan.coverity.com/projects/1222
 *
 */

// When tag is 1 or 2, let coverity know that execution is halting. Those
// tags correspond to INT_FATAL and USR_FATAL respectively.
//
// INT_FATAL, et al, work by calling setupError and then
// handleError. setupError simply sets some static globals, then handleError
// looks at those to decide how to error. For example, when INT_FATAL calls
// handleError it will abort execution because exit_immediately is true.
//
// Here we're fibbing to coverity by telling it that setupError results in
// abort (as opposed to handleError), but the effect should be the same.
void setupError(const char *filename, int lineno, int tag) {
  if (tag == 1 || tag == 2) {
    __coverity_panic__();
  }
}

//==============================
// runtime
//

//
// exit() ends execution
//
void exit(int status) {
  __coverity_panic__();
}

/**
 * Coverity Scan model
 *
 * Manage false positives by giving coverity some hints.
 *
 * Updates to this file must be manually submitted by an admin to:
 *
 *   https://scan.coverity.com/projects/1222
 *
 */

// When tag is 1 or 2, let coverity know that execution is halting. Those
// tags correspond to INT_FATAL and USR_FATAL respectively.
//
// INT_FATAL, et al, work by calling setupError and then
// handleError. setupError simply sets some static globals, then handleError
// looks at those to decide how to error. For example, when INT_FATAL calls
// handleError it will abort execution because exit_immediately is true.
//
// Here we're fibbing to coverity by telling it that setupError results in
// abort (as opposed to handleError), but the effect should be the same.
void setupError(const char *filename, int lineno, int tag) {
  if (tag == 1 || tag == 2) {
    __coverity_panic__();
  }
}

//==============================
// runtime
//

// chpl_error() ends execution
// Note: this signature doesn't match the real one precisely, but it's
//       close enough.
void chpl_error(const char* message, int lineno, const char* filename) {
  __coverity_panic__();
}

// chpl_internal_error() ends execution
void chpl_internal_error(const char* message) {
  __coverity_panic__();
}

--- 
+++ 
@@ -29,14 +29,9 @@
 // runtime
 //
 
-// chpl_error() ends execution
-// Note: this signature doesn't match the real one precisely, but it's
-//       close enough.
-void chpl_error(const char* message, int lineno, const char* filename) {
+//
+// exit() ends execution
+//
+void exit(int status) {
   __coverity_panic__();
 }
-
-// chpl_internal_error() ends execution
-void chpl_internal_error(const char* message) {
-  __coverity_panic__();
-}
Add exit() as program terminator; remove chpl_error(), chpl_internal_error().

I had thought Coverity would assume that exit() in C code would halt the
program, but indications are that it does not.  If it did, then Coverity
would see that chpl_error() and chpl_internal_error() both caused
program termination, because both call chpl_exit_any(), which calls
chpl_exit_common(), which calls exit().  Coverity did not seem to be
picking this up, and it also failed to respond to the modelling file
telling it that chpl_error() and chpl_internal_error() caused a halt.
I've found an indication on the web that Coverity does not by default
assume that exit() cause a halt, so here I'm saying so explicitly.
