? alt-assert.patch
Index: src/data/any-reader.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/any-reader.c,v
retrieving revision 1.5
diff -u -p -r1.5 any-reader.c
--- src/data/any-reader.c	17 Apr 2006 01:54:15 -0000	1.5
+++ src/data/any-reader.c	5 Jul 2006 04:59:59 -0000
@@ -24,6 +24,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include "file-handle-def.h"
 #include "file-name.h"
@@ -139,7 +140,7 @@ any_reader_open (struct file_handle *han
       return make_any_reader (SCRATCH_FILE,
                               scratch_reader_open (handle, dict));
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Reads a single case from READER into C.
@@ -158,7 +159,7 @@ any_reader_read (struct any_reader *read
     case SCRATCH_FILE:
       return scratch_reader_read_case (reader->private, c);
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if an I/O error has occurred on READER, false
@@ -177,7 +178,7 @@ any_reader_error (struct any_reader *rea
     case SCRATCH_FILE:
       return scratch_reader_error (reader->private);
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Closes READER. */
@@ -202,7 +203,7 @@ any_reader_close (struct any_reader *rea
       break;
 
     default:
-      abort ();
+      NOT_REACHED ();
     }
 
   free (reader);
Index: src/data/any-writer.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/any-writer.c,v
retrieving revision 1.5
diff -u -p -r1.5 any-writer.c
--- src/data/any-writer.c	17 Apr 2006 01:54:15 -0000	1.5
+++ src/data/any-writer.c	5 Jul 2006 04:59:59 -0000
@@ -24,6 +24,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include "file-handle-def.h"
 #include "file-name.h"
@@ -85,7 +86,7 @@ any_writer_open (struct file_handle *han
                                                                   dict));
     }
 
-  abort ();
+  NOT_REACHED ();
 }
 
 /* If PRIVATE is non-null, creates and returns a new any_writer,
@@ -162,7 +163,7 @@ any_writer_write (struct any_writer *wri
     case SCRATCH_FILE:
       return scratch_writer_write_case (writer->private, c);
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if an I/O error has occurred on WRITER, false
@@ -181,7 +182,7 @@ any_writer_error (const struct any_write
     case SCRATCH_FILE:
       return scratch_writer_error (writer->private);
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Closes WRITER.
@@ -209,7 +210,7 @@ any_writer_close (struct any_writer *wri
       break;
       
     default:
-      abort ();
+      NOT_REACHED ();
     }
 
   free (writer);
Index: src/data/category.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/category.c,v
retrieving revision 1.3
diff -u -p -r1.3 category.c
--- src/data/category.c	25 Mar 2006 22:46:21 -0000	1.3
+++ src/data/category.c	5 Jul 2006 04:59:59 -0000
@@ -32,12 +32,16 @@
   'cat_var'.
 */
 #include <config.h>
+
+#include "category.h"
+
+#include <assert.h>
 #include <stdlib.h>
+#include <string.h>
+
 #include <libpspp/alloc.h>
 #include <libpspp/message.h>
-#include "category.h"
 #include "cat-routines.h"
-#include <string.h>
 #include "variable.h"
 
 #define N_INITIAL_CATEGORIES 1
Index: src/data/category.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/category.h,v
retrieving revision 1.1
diff -u -p -r1.1 category.h
--- src/data/category.h	4 Mar 2006 01:11:57 -0000	1.1
+++ src/data/category.h	5 Jul 2006 04:59:59 -0000
@@ -37,7 +37,7 @@
 #define CAT_H
 #define CAT_VALUE_NOT_FOUND -2
 #include <stdbool.h>
-
+#include <stddef.h>
 
 union value;
 struct variable ; 
Index: src/data/data-out.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/data-out.c,v
retrieving revision 1.5
diff -u -p -r1.5 data-out.c
--- src/data/data-out.c	7 May 2006 02:18:32 -0000	1.5
+++ src/data/data-out.c	5 Jul 2006 05:00:00 -0000
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <time.h>
 #include "calendar.h"
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include "format.h"
 #include <libpspp/magic.h>
@@ -101,12 +102,10 @@ data_out (char *s, const struct fmt_spec
           break;
 
         case FMT_A:
-          assert (0);
-          abort ();
+          NOT_REACHED ();
 
         case FMT_AHEX:
-          assert (0);
-          abort ();
+          NOT_REACHED ();
 
         case FMT_IB:
           ok = convert_IB (s, fp, number);
@@ -159,8 +158,7 @@ data_out (char *s, const struct fmt_spec
           break;
 
         default:
-          assert (0);
-          abort ();
+          NOT_REACHED ();
         }
     }
   else 
@@ -179,8 +177,7 @@ data_out (char *s, const struct fmt_spec
           break;
 
         default:
-          assert (0);
-          abort ();
+          NOT_REACHED ();
         }
     }
 
@@ -751,7 +748,7 @@ convert_date (char *dst, const struct fm
       }
       break;
     default:
-      assert (0);
+      NOT_REACHED ();
     }
 
   if (buf[0] == 0)
Index: src/data/file-handle-def.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/file-handle-def.c,v
retrieving revision 1.5
diff -u -p -r1.5 file-handle-def.c
--- src/data/file-handle-def.c	17 Apr 2006 01:54:15 -0000	1.5
+++ src/data/file-handle-def.c	5 Jul 2006 05:00:00 -0000
@@ -18,16 +18,19 @@
    02110-1301, USA. */
 
 #include <config.h>
+
 #include "file-handle-def.h"
-#include <libpspp/message.h>
+
+#include <assert.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
+
 #include <libpspp/alloc.h>
 #include <libpspp/compiler.h>
-#include "file-name.h"
-#include <libpspp/message.h>
 #include <libpspp/magic.h>
+#include <libpspp/message.h>
+#include "file-name.h"
 #include "variable.h"
 #include "scratch-handle.h"
 
Index: src/data/format.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/format.c,v
retrieving revision 1.6
diff -u -p -r1.6 format.c
--- src/data/format.c	19 Jun 2006 10:16:51 -0000	1.6
+++ src/data/format.c	5 Jul 2006 05:00:01 -0000
@@ -20,6 +20,7 @@
 #include <config.h>
 #include "format.h"
 #include <ctype.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <stdlib.h>
 #include <libpspp/compiler.h>
@@ -280,7 +281,7 @@ convert_fmt_ItoO (const struct fmt_spec 
     case FMT_CCC:
     case FMT_CCD:
     case FMT_CCE:
-      assert (0);
+      NOT_REACHED ();
     case FMT_Z:
     case FMT_A:
       /* nothing is necessary */
@@ -314,7 +315,7 @@ convert_fmt_ItoO (const struct fmt_spec 
       /* nothing is necessary */
       break;
     default:
-      assert (0);
+      NOT_REACHED ();
     }
 
   assert (check_output_specifier (output, 0));
Index: src/data/missing-values.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/missing-values.c,v
retrieving revision 1.2
diff -u -p -r1.2 missing-values.c
--- src/data/missing-values.c	15 Mar 2006 03:29:10 -0000	1.2
+++ src/data/missing-values.c	5 Jul 2006 05:00:01 -0000
@@ -21,6 +21,7 @@
 #include "missing-values.h"
 #include <assert.h>
 #include <stdlib.h>
+#include <libpspp/assertion.h>
 #include <libpspp/str.h>
 
 
@@ -90,7 +91,7 @@ mv_add_value (struct missing_values *mv,
     case MV_RANGE_1:
       return false;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Attempts to add S to the set of string missing values MV.  S
@@ -139,7 +140,7 @@ mv_add_num_range (struct missing_values 
     case MV_RANGE_1:
       return false;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if MV contains an individual value,
@@ -159,7 +160,7 @@ mv_has_value (const struct missing_value
     case MV_RANGE:
       return false;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Removes one individual value from MV and stores it in *V.
@@ -224,7 +225,7 @@ mv_has_range (const struct missing_value
     case MV_3:
       return false;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Removes the numeric range from MV and stores it in *LOW and
@@ -275,7 +276,7 @@ using_element (unsigned type, int idx) 
     case MV_RANGE_1:
       return true;
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if S contains only spaces between indexes
@@ -398,7 +399,7 @@ mv_is_num_user_missing (const struct mis
     case MV_RANGE_1:
       return v[0].f == d || (v[1].f <= d && d <= v[2].f);
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if S[] is a missing value in MV, false otherwise.
@@ -425,9 +426,9 @@ mv_is_str_user_missing (const struct mis
               || !memcmp (v[2].s, s, mv->width));
     case MV_RANGE:
     case MV_RANGE_1:
-      abort ();
+      NOT_REACHED ();
     }
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Returns true if MV is a set of numeric missing values and V is
Index: src/data/sys-file-reader.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/sys-file-reader.c,v
retrieving revision 1.21
diff -u -p -r1.21 sys-file-reader.c
--- src/data/sys-file-reader.c	5 Jul 2006 02:52:35 -0000	1.21
+++ src/data/sys-file-reader.c	5 Jul 2006 05:00:02 -0000
@@ -26,6 +26,7 @@
 #include <minmax.h>
 
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/compiler.h>
 #include <libpspp/magic.h>
@@ -1619,7 +1620,7 @@ read_compressed_data (struct sfm_reader 
       p = r->x;
     }
 
-  abort ();
+  NOT_REACHED ();
 
  success:
   /* We have filled up an entire record.  Update state and return
Index: src/data/variable.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/variable.c,v
retrieving revision 1.8
diff -u -p -r1.8 variable.c
--- src/data/variable.c	7 May 2006 02:18:32 -0000	1.8
+++ src/data/variable.c	5 Jul 2006 05:00:02 -0000
@@ -19,6 +19,7 @@
 
 #include <config.h>
 #include "variable.h"
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <stdlib.h>
 #include <libpspp/alloc.h>
@@ -346,8 +347,7 @@ dict_class_to_name (enum dict_class dict
     case DC_SCRATCH:
       return _("scratch");
     default:
-      assert (0);
-      abort ();
+      NOT_REACHED ();
     }
 }
 
Index: src/language/command.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/command.c,v
retrieving revision 1.13
diff -u -p -r1.13 command.c
--- src/language/command.c	28 Jun 2006 18:40:21 -0000	1.13
+++ src/language/command.c	5 Jul 2006 05:00:03 -0000
@@ -34,6 +34,7 @@
 #include <language/lexer/lexer.h>
 #include <language/line-buffer.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/message.h>
 #include <libpspp/message.h>
@@ -421,7 +422,7 @@ find_command (const char *name) 
   for (cmd = commands; cmd < commands + command_cnt; cmd++) 
     if (!strcmp (cmd->name, name))
       return cmd;
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Frees the WORD_CNT words in WORDS. */
@@ -595,7 +596,7 @@ report_state_mismatch (const struct comm
       else if (allowed_cnt == 3)
         s = xasprintf (_("%s, %s, or %s"), allowed[0], allowed[1], allowed[2]);
       else
-        abort ();
+        NOT_REACHED ();
 
       msg (SE, _("%s is allowed only %s."), command->name, s);
 
Index: src/language/line-buffer.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/line-buffer.c,v
retrieving revision 1.14
diff -u -p -r1.14 line-buffer.c
--- src/language/line-buffer.c	4 Jul 2006 04:39:04 -0000	1.14
+++ src/language/line-buffer.c	5 Jul 2006 05:00:03 -0000
@@ -31,6 +31,7 @@
 #include <language/command.h>
 #include <language/lexer/lexer.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/message.h>
 #include <libpspp/str.h>
@@ -493,7 +494,7 @@ read_line_from_source (struct string *li
       return s->u.interactive (line, get_prompt_style ());
     }
 
-  abort ();
+  NOT_REACHED ();
 }
 
 /* Reads a single line into LINE.
Index: src/language/data-io/data-list.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/data-list.c,v
retrieving revision 1.17
diff -u -p -r1.17 data-list.c
--- src/language/data-io/data-list.c	27 Jun 2006 19:09:21 -0000	1.17
+++ src/language/data-io/data-list.c	5 Jul 2006 05:00:04 -0000
@@ -41,6 +41,7 @@
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/message.h>
 #include <libpspp/message.h>
@@ -999,7 +1000,7 @@ read_from_data_list (const struct data_l
       retval = read_from_data_list_list (dls, c);
       break;
     default:
-      abort ();
+      NOT_REACHED ();
     }
   dfm_pop (dls->reader);
 
Index: src/language/data-io/data-reader.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/data-reader.c,v
retrieving revision 1.11
diff -u -p -r1.11 data-reader.c
--- src/language/data-io/data-reader.c	9 Jun 2006 22:51:24 -0000	1.11
+++ src/language/data-io/data-reader.c	5 Jul 2006 05:00:04 -0000
@@ -34,6 +34,7 @@
 #include <language/lexer/lexer.h>
 #include <language/line-buffer.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/str.h>
 
@@ -224,7 +225,7 @@ read_file_record (struct dfm_reader *r)
         }
     }
   else
-    abort ();
+    NOT_REACHED ();
 
   r->where.line_number++;
 
Index: src/language/data-io/file-handle.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/file-handle.q,v
retrieving revision 1.6
diff -u -p -r1.6 file-handle.q
--- src/language/data-io/file-handle.q	28 Jun 2006 02:21:28 -0000	1.6
+++ src/language/data-io/file-handle.q	5 Jul 2006 05:00:04 -0000
@@ -27,6 +27,7 @@
 #include <language/command.h>
 #include <language/lexer/lexer.h>
 #include <language/line-buffer.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/magic.h>
 #include <libpspp/str.h>
@@ -109,7 +110,7 @@ cmd_file_handle (void)
         properties.record_width = cmd.n_lrecl[0];
       break;
     default:
-      assert (0);
+      NOT_REACHED ();
     }
 
   if (cmd.mode != FH_SCRATCH)
@@ -154,7 +155,7 @@ referent_name (enum fh_referent referent
     case FH_REF_SCRATCH:
       return _("scratch file");
     default:
-      abort ();
+      NOT_REACHED ();
     }
 }
 
Index: src/language/data-io/get.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/get.c,v
retrieving revision 1.14
diff -u -p -r1.14 get.c
--- src/language/data-io/get.c	2 Jul 2006 04:25:12 -0000	1.14
+++ src/language/data-io/get.c	5 Jul 2006 05:00:05 -0000
@@ -41,6 +41,7 @@
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
 #include <libpspp/message.h>
@@ -843,7 +844,7 @@ cmd_match_files (void)
           saw_table = true;
         }
       else
-        assert (0);
+        NOT_REACHED ();
       lex_match ('=');
 
       file->by = NULL;
@@ -1169,7 +1170,7 @@ mtf_processing_finish (void *mtf_)
     if (iter->handle == NULL)
       {
         if (!mtf_delete_file_in_place (mtf, &iter))
-          abort ();
+          NOT_REACHED ();
         break;
       }
   
Index: src/language/data-io/inpt-pgm.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/inpt-pgm.c,v
retrieving revision 1.11
diff -u -p -r1.11 inpt-pgm.c
--- src/language/data-io/inpt-pgm.c	28 Jun 2006 05:49:03 -0000	1.11
+++ src/language/data-io/inpt-pgm.c	5 Jul 2006 05:00:06 -0000
@@ -37,6 +37,7 @@
 #include <language/expressions/public.h>
 #include <language/lexer/lexer.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/message.h>
 #include <libpspp/message.h>
@@ -205,7 +206,7 @@ init_case (const struct input_program_pg
         memset (case_data_rw (c, i)->s, ' ', sizeof case_data_rw (c, i)->s);
         break;
       default:
-        assert (0);
+        NOT_REACHED ();
       }
 }
 
@@ -229,7 +230,7 @@ clear_case (const struct input_program_p
         memset (case_data_rw (c, i)->s, ' ', sizeof case_data_rw (c, i)->s);
         break;
       default:
-        assert (0);
+        NOT_REACHED ();
       }
 }
 
Index: src/language/data-io/list.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/list.q,v
retrieving revision 1.13
diff -u -p -r1.13 list.q
--- src/language/data-io/list.q	28 Jun 2006 02:21:28 -0000	1.13
+++ src/language/data-io/list.q	5 Jul 2006 05:00:06 -0000
@@ -269,7 +269,7 @@ write_all_headers (const struct ccase *c
 	  fputs ("  </TR>\n", x->file);
 	}
       else
-	assert (0);
+	NOT_REACHED ();
     }
 }
 
@@ -387,7 +387,7 @@ clean_up (void)
 	  }
       }
     else
-      assert (0);
+      NOT_REACHED ();
   
   free (cmd.v_variables);
 }
@@ -718,7 +718,7 @@ list_cases (const struct ccase *c, void 
 	fputs ("  </TR>\n", x->file);
       }
     else
-      assert (0);
+      NOT_REACHED ();
 
   return true;
 }
Index: src/language/data-io/matrix-data.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/matrix-data.c,v
retrieving revision 1.9
diff -u -p -r1.9 matrix-data.c
--- src/language/data-io/matrix-data.c	27 Jun 2006 19:09:21 -0000	1.9
+++ src/language/data-io/matrix-data.c	5 Jul 2006 05:00:07 -0000
@@ -36,6 +36,7 @@
 #include <language/lexer/variable-parser.h>
 #include <libpspp/alloc.h>
 #include <libpspp/array.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/message.h>
 #include <libpspp/message.h>
@@ -754,7 +755,7 @@ mdump_token (const struct matrix_token *
       printf (" '%.*s'", token->length, token->string);
       break;
     default:
-      assert (0);
+      NOT_REACHED ();
     }
   fflush (stdout);
 }
@@ -1066,16 +1067,14 @@ nr_read_data_lines (struct nr_aux_data *
 	      n_cols = mx->n_continuous;
 	      break;
 	    default:
-	      assert (0);
-              abort ();
+              NOT_REACHED ();
 	    }
 	  break;
 	case 2:
 	  n_cols = 1;
 	  break;
 	default:
-	  assert (0);
-          abort ();
+          NOT_REACHED ();
 	}
 
       {
@@ -1935,13 +1934,11 @@ wr_read_indeps (struct wr_aux_data *wr)
 	  n_cols = mx->n_continuous;
 	  break;
 	default:
-	  assert (0);
-          abort ();
+          NOT_REACHED ();
 	}
       break;
     default:
-      assert (0);
-      abort ();
+      NOT_REACHED ();
     }
   c->n_rows[wr->content]++;
 
Index: src/language/data-io/print.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/print.c,v
retrieving revision 1.10
diff -u -p -r1.10 print.c
--- src/language/data-io/print.c	27 Jun 2006 19:09:21 -0000	1.10
+++ src/language/data-io/print.c	5 Jul 2006 05:00:07 -0000
@@ -34,6 +34,7 @@
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/message.h>
 #include <libpspp/message.h>
@@ -838,7 +839,7 @@ dump_table (const struct file_handle *fh
       case PRT_SPACE:
 	break;
       case PRT_ERROR:
-	assert (0);
+        NOT_REACHED ();
       }
 
   if (fh != NULL)
@@ -883,8 +884,7 @@ alloc_line (void)
 	  break;
 	case PRT_ERROR:
         default:
-	  assert (0);
-          abort ();
+          NOT_REACHED ();
 	}
       if (pot_w > w)
 	w = pot_w;
@@ -958,8 +958,7 @@ print_trns_proc (void *trns_, struct cca
 	break;
 
       case PRT_ERROR:
-	assert (0);
-	break;
+        NOT_REACHED ();
       }
 
   if (t->writer != NULL && dfm_write_error (t->writer))
@@ -988,8 +987,7 @@ print_trns_free (void *prt_)
 	  /* nothing to do */
 	  break;
 	case PRT_ERROR:
-	  assert (0);
-	  break;
+	  NOT_REACHED ();
 	}
       n = i->next;
       free (i);
Index: src/language/dictionary/modify-variables.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/dictionary/modify-variables.c,v
retrieving revision 1.6
diff -u -p -r1.6 modify-variables.c
--- src/language/dictionary/modify-variables.c	27 Jun 2006 19:09:22 -0000	1.6
+++ src/language/dictionary/modify-variables.c	5 Jul 2006 05:00:08 -0000
@@ -28,6 +28,7 @@
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/array.h>
 #include <libpspp/bit-vector.h>
 #include <libpspp/compiler.h>
@@ -259,7 +260,7 @@ cmd_modify_vars (void)
                               compare_variables_given_ordering,
                               &forward_positional_ordering)
               != drop_cnt)
-            assert (0);
+            NOT_REACHED ();
 
           free (keep_vars);
           free (all_vars);
@@ -420,7 +421,7 @@ validate_var_modification (const struct 
                       keep_vars,
                       compare_variables_given_ordering,
                       &forward_positional_ordering) != keep_cnt)
-    assert (0);
+    NOT_REACHED ();
 
   /* Copy variables into var_renaming array. */
   var_renaming = xnmalloc (keep_cnt, sizeof *var_renaming);
@@ -514,7 +515,7 @@ rearrange_dict (struct dictionary *d, co
   /* Do renaming. */
   if (dict_rename_vars (d, rename_vars, rename_new_names, rename_cnt,
                         NULL) == 0)
-    assert (0);
+    NOT_REACHED ();
 
   /* Clean up. */
   for (i = 0; i < vm->rename_cnt; i++)
Index: src/language/dictionary/numeric.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/dictionary/numeric.c,v
retrieving revision 1.9
diff -u -p -r1.9 numeric.c
--- src/language/dictionary/numeric.c	27 Jun 2006 19:09:22 -0000	1.9
+++ src/language/dictionary/numeric.c	5 Jul 2006 05:00:08 -0000
@@ -27,7 +27,7 @@
 #include <language/command.h>
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
-#include <libpspp/message.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/str.h>
 
@@ -151,8 +151,7 @@ cmd_string (void)
 	  width = f.w / 2;
 	  break;
 	default:
-	  assert (0);
-          abort ();
+          NOT_REACHED ();
 	}
 
       /* Create each variable. */
Index: src/language/dictionary/vector.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/dictionary/vector.c,v
retrieving revision 1.6
diff -u -p -r1.6 vector.c
--- src/language/dictionary/vector.c	27 Jun 2006 19:09:22 -0000	1.6
+++ src/language/dictionary/vector.c	5 Jul 2006 05:00:08 -0000
@@ -28,6 +28,7 @@
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/misc.h>
 #include <libpspp/str.h>
@@ -177,7 +178,7 @@ cmd_vector (void)
 		  v[i] = dict_create_var_assert (default_dict, name, 0);
 		}
               if (!dict_create_vector (default_dict, cp, v, nv))
-                assert (0);
+                NOT_REACHED ();
 	      cp += strlen (cp) + 1;
 	    }
           free (v);
Index: src/language/expressions/evaluate.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/expressions/evaluate.c,v
retrieving revision 1.5
diff -u -p -r1.5 evaluate.c
--- src/language/expressions/evaluate.c	9 Jun 2006 22:51:24 -0000	1.5
+++ src/language/expressions/evaluate.c	5 Jul 2006 05:00:08 -0000
@@ -22,6 +22,7 @@
 
 #include <ctype.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include "helpers.h"
 #include "evaluate.h"
@@ -67,7 +68,7 @@ expr_evaluate (struct expression *e, con
 #include "evaluate.inc"
           
 	default:
-	  abort ();
+	  NOT_REACHED ();
 	}
     }
 }
@@ -233,7 +234,7 @@ cmd_debug_evaluate (void)
         }
 
       default:
-        assert (0);
+        NOT_REACHED ();
       }
 
   expr_free (expr);
@@ -299,7 +300,7 @@ expr_debug_print_postfix (const struct e
           fprintf (stderr, "i<%d>", op->integer);
           break;
         default:
-          abort ();
+          NOT_REACHED ();
         } 
     }
   fprintf (stderr, "\n");
Index: src/language/expressions/evaluate.inc.pl
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/expressions/evaluate.inc.pl,v
retrieving revision 1.1
diff -u -p -r1.1 evaluate.inc.pl
--- src/language/expressions/evaluate.inc.pl	4 Mar 2006 01:11:57 -0000	1.1
+++ src/language/expressions/evaluate.inc.pl	5 Jul 2006 05:00:09 -0000
@@ -6,7 +6,7 @@ sub generate_output {
 
 	if ($op->{UNIMPLEMENTED}) {
 	    print "case $opname:\n";
-	    print "  abort ();\n\n";
+	    print "  NOT_REACHED ();\n\n";
 	    next;
 	}
 
Index: src/language/expressions/optimize.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/expressions/optimize.c,v
retrieving revision 1.3
diff -u -p -r1.3 optimize.c
--- src/language/expressions/optimize.c	9 Jun 2006 22:51:24 -0000	1.3
+++ src/language/expressions/optimize.c	5 Jul 2006 05:00:09 -0000
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <data/calendar.h>
 #include <data/data-in.h>
 #include <libpspp/message.h>
@@ -157,12 +158,10 @@ evaluate_tree (struct composite_node *no
 #include "optimize.inc"
 
     default:
-      assert (0);
+      NOT_REACHED ();
     }
 
-  /* Not reached. */
-  assert (0);
-  abort ();
+  NOT_REACHED ();
 }
 
 static double
@@ -302,7 +301,7 @@ flatten_atom (union any_node *n, struct 
       break;
 
     default:
-      abort ();
+      NOT_REACHED ();
     }
 }
 
@@ -363,7 +362,7 @@ flatten_node (union any_node *n, struct 
   else if (is_composite (n->type))
     flatten_composite (n, e);
   else 
-    abort ();
+    NOT_REACHED ();
 }
 
 static union operation_data *
Index: src/language/expressions/optimize.inc.pl
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/expressions/optimize.inc.pl,v
retrieving revision 1.1
diff -u -p -r1.1 optimize.inc.pl
--- src/language/expressions/optimize.inc.pl	4 Mar 2006 01:11:57 -0000	1.1
+++ src/language/expressions/optimize.inc.pl	5 Jul 2006 05:00:09 -0000
@@ -6,7 +6,7 @@ sub generate_output {
 
 	if (!$op->{OPTIMIZABLE} || $op->{UNIMPLEMENTED}) {
 	    print "case $opname:\n";
-	    print "  abort ();\n\n";
+	    print "  NOT_REACHED ();\n\n";
 	    next;
 	}
 
Index: src/language/expressions/parse.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/expressions/parse.c,v
retrieving revision 1.11
diff -u -p -r1.11 parse.c
--- src/language/expressions/parse.c	27 Jun 2006 19:09:22 -0000	1.11
+++ src/language/expressions/parse.c	5 Jul 2006 05:00:10 -0000
@@ -31,6 +31,7 @@
 #include "helpers.h"
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
+#include <libpspp/assertion.h>
 #include <libpspp/misc.h>
 #include <libpspp/pool.h>
 #include <data/settings.h>
@@ -167,7 +168,7 @@ atom_type_stack (atom_type type)
       return &not_on_stack;
           
     default:
-      abort ();
+      NOT_REACHED ();
     }
 }
 
@@ -271,7 +272,7 @@ type_check (struct expression *e,
       break;
 
     default:
-      abort ();
+      NOT_REACHED ();
     }
   
   return true;
@@ -345,7 +346,7 @@ type_coercion_core (struct expression *e
       break;
 
     case OP_format:
-      abort ();
+      NOT_REACHED ();
 
     case OP_ni_format:
       if ((*node)->type == OP_format
@@ -399,7 +400,7 @@ type_coercion_core (struct expression *e
       break;
 
     default:
-      abort ();
+      NOT_REACHED ();
     }
 
   if (do_coercion) 
@@ -1282,7 +1283,7 @@ expr_node_returns (const union any_node 
   else if (is_composite (n->type))
     return operations[n->type].returns;
   else
-    abort ();
+    NOT_REACHED ();
 }
 
 static const char *
Index: src/language/lexer/lexer.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/lexer.c,v
retrieving revision 1.6
diff -u -p -r1.6 lexer.c
--- src/language/lexer/lexer.c	9 Jun 2006 22:51:24 -0000	1.6
+++ src/language/lexer/lexer.c	5 Jul 2006 05:00:10 -0000
@@ -27,6 +27,7 @@
 #include <stdarg.h>
 #include <stdlib.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <language/command.h>
 #include <libpspp/message.h>
 #include <language/line-buffer.h>
@@ -934,7 +935,7 @@ lex_token_representation (void)
 	}
     }
 	
-  assert (0);
+  NOT_REACHED ();
 }
 
 /* Really weird functions. */
@@ -1018,7 +1019,7 @@ convert_numeric_string_to_char_string (e
       chars_per_byte = 2;
       break;
     default:
-      abort ();
+      NOT_REACHED ();
     }
   
   byte_cnt = ds_length (&tokstr) / chars_per_byte;
Index: src/language/lexer/q2c.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/q2c.c,v
retrieving revision 1.12
diff -u -p -r1.12 q2c.c
--- src/language/lexer/q2c.c	28 Jun 2006 02:21:28 -0000	1.12
+++ src/language/lexer/q2c.c	5 Jul 2006 05:00:11 -0000
@@ -27,6 +27,7 @@
 #include <time.h>
 #include <errno.h>
 #include <unistd.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/str.h>
 #include "exit.h"
@@ -1322,7 +1323,7 @@ dump_vars_init (int persistent)
 		break;
 
 	      default:
-		assert (0);
+		NOT_REACHED ();
 	      }
 	  }
       }
@@ -1710,7 +1711,7 @@ dump_subcommand (const subcommand *sbc)
       dump (0, "goto lossage;");
       dump (-1, "default:");
       indent ();
-      dump (0, "assert (0);");
+      dump (0, "NOT_REACHED ();");
       dump (-1, "}");
       outdent ();
     }
@@ -1776,7 +1777,7 @@ dump_parser (int persistent)
       dump (0, "break;");
       dump (-1, "default:");
       indent ();
-      dump (0, "assert (0);");
+      dump (0, "NOT_REACHED ();");
       dump (-1, "}");
       outdent ();
     }
@@ -2031,6 +2032,7 @@ main (int argc, char *argv[])
 
 	  dump (0, "#include <stdlib.h>");
 	  dump (0, "#include <libpspp/alloc.h>");
+	  dump (0, "#include <libpspp/assertion.h>");
 	  dump (0, "#include <libpspp/message.h>");
 	  dump (0, "#include <language/lexer/lexer.h>");
 	  dump (0, "#include <language/lexer/variable-parser.h>");
Index: src/language/stats/aggregate.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/aggregate.c,v
retrieving revision 1.12
diff -u -p -r1.12 aggregate.c
--- src/language/stats/aggregate.c	27 Jun 2006 19:09:22 -0000	1.12
+++ src/language/stats/aggregate.c	5 Jul 2006 05:00:13 -0000
@@ -38,7 +38,7 @@
 #include <language/lexer/variable-parser.h>
 #include <language/stats/sort-criteria.h>
 #include <libpspp/alloc.h>
-#include <libpspp/message.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/misc.h>
 #include <libpspp/pool.h>
@@ -892,7 +892,7 @@ accumulate_aggregate_info (struct agr_pr
                caught earlier.  Nothing to do. */
             break;
 	  default:
-	    assert (0);
+	    NOT_REACHED ();
 	  }
     } else {
       switch (iter->function)
@@ -904,7 +904,7 @@ accumulate_aggregate_info (struct agr_pr
 	  iter->int1++;
 	  break;
 	default:
-	  assert (0);
+	  NOT_REACHED ();
 	}
     }
 }
@@ -1033,7 +1033,7 @@ dump_aggregate_info (struct agr_proc *ag
 	    v->f = i->int1;
 	    break;
 	  default:
-	    assert (0);
+	    NOT_REACHED ();
 	  }
       }
   }
Index: src/language/stats/crosstabs.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/crosstabs.q,v
retrieving revision 1.11
diff -u -p -r1.11 crosstabs.q
--- src/language/stats/crosstabs.q	28 Jun 2006 02:21:28 -0000	1.11
+++ src/language/stats/crosstabs.q	5 Jul 2006 05:00:14 -0000
@@ -47,6 +47,7 @@
 #include <language/lexer/variable-parser.h>
 #include <libpspp/alloc.h>
 #include <libpspp/array.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
 #include <libpspp/magic.h>
@@ -1799,8 +1800,7 @@ display_crosstabulation (void)
 				 * (1. - col_tot[c] / W)));
 		    break;
 		  default:
-		    assert (0);
-                    abort ();
+                    NOT_REACHED ();
 		  }
 
                 format_cell_entry (table, c, i, v, suffix, mark_missing);
@@ -1855,8 +1855,7 @@ display_crosstabulation (void)
                 v = 0.;
                 break;
               default:
-                assert (0);
-                abort ();
+                NOT_REACHED ();
               }
 
             format_cell_entry (table, n_cols, 0, v, suffix, mark_missing);
@@ -1911,8 +1910,7 @@ display_crosstabulation (void)
 	      case CRS_CL_ASRESIDUAL:
 		continue;
 	      default:
-		assert (0);
-                abort ();
+                NOT_REACHED ();
 	      }
 
             format_cell_entry (table, c, i, v, suffix, mark_missing);
Index: src/language/stats/flip.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/flip.c,v
retrieving revision 1.10
diff -u -p -r1.10 flip.c
--- src/language/stats/flip.c	27 Jun 2006 19:09:22 -0000	1.10
+++ src/language/stats/flip.c	5 Jul 2006 05:00:14 -0000
@@ -41,6 +41,7 @@
 #include <language/lexer/variable-parser.h>
 #include <libpspp/alloc.h>
 #include <libpspp/array.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/message.h>
 #include <libpspp/misc.h>
@@ -538,7 +539,7 @@ flip_source_read (struct case_source *so
           else if (feof (flip->file))
             msg (SE, _("Unexpected end of file reading FLIP temporary file."));
           else
-            abort ();
+            NOT_REACHED ();
           ok = false;
           break;
         }
Index: src/language/stats/frequencies.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/frequencies.q,v
retrieving revision 1.11
diff -u -p -r1.11 frequencies.q
--- src/language/stats/frequencies.q	28 Jun 2006 02:21:28 -0000	1.11
+++ src/language/stats/frequencies.q	5 Jul 2006 05:00:15 -0000
@@ -557,7 +557,7 @@ calc (const struct ccase *c, void *aux U
 	    ft->out_of_range += weight;
 	  break;
 	default:
-	  assert (0);
+          NOT_REACHED ();
 	}
     }
   return true;
@@ -645,7 +645,7 @@ postcalc (void *aux UNUSED)
 	      dump_full (v);
 	    break;
 	  default:
-	    assert (0);
+            NOT_REACHED ();
 	  }
       else
 	dumped_freq_tab = 0;
@@ -706,7 +706,7 @@ get_freq_comparator (int frq_sort, int v
     case FRQ_AFREQ | (ALPHA << 16):     return compare_freq_alpha_a;
     case FRQ_DFREQ | (NUMERIC << 16):   return compare_freq_numeric_d;
     case FRQ_DFREQ | (ALPHA << 16):     return compare_freq_alpha_d;
-    default: assert (0);
+    default: NOT_REACHED ();
     }
 
   return 0;
Index: src/language/stats/t-test.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/t-test.q,v
retrieving revision 1.8
diff -u -p -r1.8 t-test.q
--- src/language/stats/t-test.q	28 Jun 2006 02:21:28 -0000	1.8
+++ src/language/stats/t-test.q	5 Jul 2006 05:00:16 -0000
@@ -36,6 +36,7 @@
 #include <language/dictionary/split-file.h>
 #include <language/lexer/lexer.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
 #include <libpspp/magic.h>
@@ -623,7 +624,7 @@ ssbox_create(struct ssbox *ssb, struct c
 	ssbox_paired_init(ssb,cmd);
 	break;
       default:
-	assert(0);
+	NOT_REACHED ();
       }
 }
 
@@ -937,7 +938,7 @@ trbox_create(struct trbox *trb,   
 	trbox_paired_init(trb,cmd);
 	break;
       default:
-	assert(0);
+        NOT_REACHED ();
       }
 }
 
@@ -1970,7 +1971,7 @@ hash_group_binary(const struct group_sta
       flag = which_group(g,p);
     }
   else
-    assert(0);
+    NOT_REACHED ();
 
   return flag;
 }
Index: src/language/utilities/set.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/utilities/set.q,v
retrieving revision 1.9
diff -u -p -r1.9 set.q
--- src/language/utilities/set.q	28 Jun 2006 02:21:28 -0000	1.9
+++ src/language/utilities/set.q	5 Jul 2006 05:00:16 -0000
@@ -110,6 +110,8 @@ int tgetnum (const char *);
      xsort=xsort:yes/no.
 */
 
+/* (headers) */
+
 /* (declarations) */
 
 /* (_functions) */
Index: src/language/xforms/recode.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/xforms/recode.c,v
retrieving revision 1.8
diff -u -p -r1.8 recode.c
--- src/language/xforms/recode.c	27 Jun 2006 19:09:22 -0000	1.8
+++ src/language/xforms/recode.c	5 Jul 2006 05:00:17 -0000
@@ -34,6 +34,7 @@
 #include <language/lexer/variable-parser.h>
 #include <language/lexer/range-parser.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/magic.h>
 #include <libpspp/message.h>
@@ -560,7 +561,7 @@ find_src_numeric (struct recode_trns *tr
           match = true;
           break;
         default:
-          abort ();
+          NOT_REACHED ();
         }
 
       if (match)
@@ -609,7 +610,7 @@ find_src_string (struct recode_trns *trn
             break;
           }
         default:
-          abort ();
+          NOT_REACHED ();
         }
 
       if (match)
Index: src/libpspp/array.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/libpspp/array.c,v
retrieving revision 1.3
diff -u -p -r1.3 array.c
--- src/libpspp/array.c	7 May 2006 10:11:51 -0000	1.3
+++ src/libpspp/array.c	5 Jul 2006 05:00:17 -0000
@@ -96,14 +96,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include "alloc.h"
+#include <libpspp/assertion.h>
 
-/* Some of the assertions in this file are very expensive.  We
-   don't use them by default. */
-#ifdef EXTRA_CHECKS
-#define expensive_assert(X) assert(X)
-#else
-#define expensive_assert(X) ((void) 0)
-#endif
 #include "message.h"
 
 /* Finds an element in ARRAY, which contains COUNT elements of
Index: src/libpspp/assertion.h
===================================================================
RCS file: src/libpspp/assertion.h
diff -N src/libpspp/assertion.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/libpspp/assertion.h	5 Jul 2006 05:00:18 -0000
@@ -0,0 +1,42 @@
+/* PSPP - computes sample statistics.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   Written by John Darrington <john@darrington.wattle.id.au>
+   and Ben Pfaff <blp@gnu.org>.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA. */
+
+#ifndef __PSPP_ASSERT_H
+#define __PSPP_ASSERT_H
+
+#include <stdlib.h>
+#include "compiler.h"
+
+#define NOT_REACHED() do { assert (0); abort (); } while (0)
+
+#endif 
+
+#include <assert.h>
+
+#ifndef ASSERT_LEVEL
+#define ASSERT_LEVEL 2
+#endif
+
+#undef expensive_assert
+#if ASSERT_LEVEL >= 5
+#define expensive_assert(EXPR) assert (EXPR)
+#else
+#define expensive_assert(EXPR) ((void) 0)
+#endif
Index: src/libpspp/automake.mk
===================================================================
RCS file: /cvsroot/pspp/pspp/src/libpspp/automake.mk,v
retrieving revision 1.12
diff -u -p -r1.12 automake.mk
--- src/libpspp/automake.mk	1 Jul 2006 22:34:27 -0000	1.12
+++ src/libpspp/automake.mk	5 Jul 2006 05:00:18 -0000
@@ -6,6 +6,7 @@ noinst_LIBRARIES += src/libpspp/libpspp.
 src_libpspp_libpspp_a_SOURCES = \
 	src/libpspp/array.c \
 	src/libpspp/array.h \
+	src/libpspp/assertion.h \
 	src/libpspp/alloc.c \
 	src/libpspp/alloc.h \
 	src/libpspp/bit-vector.h \
Index: src/libpspp/message.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/libpspp/message.c,v
retrieving revision 1.4
diff -u -p -r1.4 message.c
--- src/libpspp/message.c	4 Jul 2006 04:39:04 -0000	1.4
+++ src/libpspp/message.c	5 Jul 2006 05:00:18 -0000
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <libpspp/alloc.h>
 #include <libpspp/version.h>
@@ -122,58 +123,30 @@ msg_get_command_name (void) 
 }
 
 void 
-request_bug_report_and_abort(const char *msg )
+request_bug_report_and_abort (const char *msg)
 {
-  fprintf(stderr,
-	  "******************************************************************\n"
-	  "You have discovered a bug in PSPP.\n\n"
-	  "  Please report this, by sending "
-	  "an email to " PACKAGE_BUGREPORT ",\n"
-	  "explaining what you were doing when this happened, and including\n"
-	  "a sample of your input file which caused it.\n");
-
-  fprintf(stderr,
-	  "Also, please copy the following lines into your bug report:\n\n"
-	  "bare_version:        %s\n" 
-	  "version:             %s\n"
-	  "stat_version:        %s\n"
-	  "host_system:         %s\n"
-	  "build_system:        %s\n"
-	  "default_config_path: %s\n"
-	  "include_path:        %s\n"
-	  "locale_dir:          %s\n"
-	  "compiler version:    %s\n"
-	  ,
-
-	  bare_version,         
-	  version,
-	  stat_version,
-	  host_system,        
-	  build_system,
-	  default_config_path,
-	  include_path, 
-	  locale_dir,
+  fprintf (stderr, "******************************************************\n");
+  fprintf (stderr, "You have discovered a bug in PSPP.  Please report this\n");
+  fprintf (stderr, "to " PACKAGE_BUGREPORT ".  Please include this entire\n");
+  fprintf (stderr, "message, *plus* several lines of output just above it.\n");
+  fprintf (stderr, "For the best chance at having the bug fixed, also\n");
+  fprintf (stderr, "include the syntax file that triggered it and a sample\n");
+  fprintf (stderr, "of any data file used for input.\n");
+  fprintf (stderr, "proximate cause:     %s\n", msg);
+  fprintf (stderr, "version:             %s\n", stat_version);
+  fprintf (stderr, "host_system:         %s\n", host_system);
+  fprintf (stderr, "build_system:        %s\n", build_system);
+  fprintf (stderr, "default_config_path: %s\n", default_config_path);
+  fprintf (stderr, "include_path:        %s\n", include_path);
+  fprintf (stderr, "locale_dir:          %s\n", locale_dir);
+  fprintf (stderr, "compiler version:    %s\n",
 #ifdef __VERSION__
-	  __VERSION__
+           __VERSION__
 #else
-	  "Unknown"
+           "Unknown"
 #endif
-	  );     
+           );     
+  fprintf (stderr, "******************************************************\n");
 
-  if ( msg )
-    fprintf(stderr,"Diagnosis: %s\n",msg);
-
-  fprintf(stderr,
-    "******************************************************************\n");
-
-  abort();
+  _exit (EXIT_FAILURE);
 }
-
-void 
-msg_assert_fail(const char *expr, const char *file, int line)
-{
-  char msg[256];
-  snprintf(msg,256,"Assertion failed: %s:%d; (%s)",file,line,expr);
-  request_bug_report_and_abort( msg );
-}
-
Index: src/libpspp/message.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/libpspp/message.h,v
retrieving revision 1.11
diff -u -p -r1.11 message.h
--- src/libpspp/message.h	4 Jul 2006 04:39:04 -0000	1.11
+++ src/libpspp/message.h	5 Jul 2006 05:00:18 -0000
@@ -107,15 +107,6 @@ void msg_pop_msg_locator (const struct m
 
 
 /* Used in panic situations only. */
-void request_bug_report_and_abort (const char *msg);
-
-void msg_assert_fail (const char *expr, const char *file, int line);
-
-#undef __STRING
-#define __STRING(x) #x
-#undef assert
-			       
-#define assert(expr) ( (void) ( expr ? (void) 0 : \
-	       msg_assert_fail(__STRING(expr), __FILE__, __LINE__)) )
+void request_bug_report_and_abort (const char *msg) NO_RETURN;
 
 #endif /* message.h */
Index: src/libpspp/pool.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/libpspp/pool.c,v
retrieving revision 1.3
diff -u -p -r1.3 pool.c
--- src/libpspp/pool.c	8 May 2006 01:18:10 -0000	1.3
+++ src/libpspp/pool.c	5 Jul 2006 05:00:18 -0000
@@ -21,6 +21,7 @@
 #include "pool.h"
 #include <stdlib.h>
 #include "alloc.h"
+#include <libpspp/assertion.h>
 #include "message.h"
 #include "size_max.h"
 #include "str.h"
@@ -915,7 +916,7 @@ free_gizmo (struct pool_gizmo *gizmo)
       gizmo->p.registered.free (gizmo->p.registered.p);
       break;
     default:
-      assert (0);
+      NOT_REACHED ();
     }
 }
 
Index: src/math/design-matrix.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/math/design-matrix.c,v
retrieving revision 1.2
diff -u -p -r1.2 design-matrix.c
--- src/math/design-matrix.c	15 Mar 2006 03:29:11 -0000	1.2
+++ src/math/design-matrix.c	5 Jul 2006 05:00:18 -0000
@@ -21,14 +21,19 @@
   Create design matrices for procedures that need them.
 */
 #include <config.h>
+
+#include "design-matrix.h"
+
+#include <assert.h>
+#include <math.h>
 #include <stdlib.h>
+#include <string.h>
+
 #include <libpspp/alloc.h>
 #include <libpspp/message.h>
 #include <data/variable.h>
 #include <data/category.h>
-#include "design-matrix.h"
-#include <string.h>
-#include <math.h>
+
 #include <gsl/gsl_machine.h>
 #include <gsl/gsl_vector.h>
 #include <gsl/gsl_matrix.h>
Index: src/math/sort.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/math/sort.c,v
retrieving revision 1.10
diff -u -p -r1.10 sort.c
--- src/math/sort.c	10 May 2006 04:11:07 -0000	1.10
+++ src/math/sort.c	5 Jul 2006 05:00:19 -0000
@@ -37,6 +37,7 @@
 #include <language/expressions/public.h>
 #include <libpspp/alloc.h>
 #include <libpspp/array.h>
+#include <libpspp/assertion.h>
 #include <libpspp/message.h>
 #include <libpspp/message.h>
 #include <libpspp/misc.h>
@@ -173,7 +174,7 @@ do_internal_sort (struct casereader *rea
             {
               bool ok = casereader_read_xfer (reader, &cases[i].c);
               if (!ok)
-                abort ();
+                NOT_REACHED ();
               cases[i].idx = i;
             }
 
@@ -183,7 +184,7 @@ do_internal_sort (struct casereader *rea
           for (i = 0; i < case_cnt; i++)
             casefile_append_xfer (dst, &cases[i].c);
           if (casefile_error (dst))
-            abort ();
+            NOT_REACHED ();
 
           free (cases);
         }
Index: src/output/afm.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/output/afm.c,v
retrieving revision 1.3
diff -u -p -r1.3 afm.c
--- src/output/afm.c	9 Jun 2006 22:51:24 -0000	1.3
+++ src/output/afm.c	5 Jul 2006 05:00:20 -0000
@@ -31,6 +31,7 @@
 #include <setjmp.h>
 #include "error.h"
 #include "minmax.h"
+#include <libpspp/assertion.h>
 #include <libpspp/pool.h>
 #include <libpspp/str.h>
 
@@ -1146,7 +1147,7 @@ afm_encode_string (const struct afm *afm
           break;
       
         default:
-          abort ();
+          NOT_REACHED ();
         }
       binary_finish (&e);
     }
Index: src/output/ascii.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/output/ascii.c,v
retrieving revision 1.9
diff -u -p -r1.9 ascii.c
--- src/output/ascii.c	9 Jun 2006 22:51:24 -0000	1.9
+++ src/output/ascii.c	5 Jul 2006 05:00:20 -0000
@@ -26,6 +26,7 @@
 
 #include <data/file-name.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/pool.h>
 #include <libpspp/start-date.h>
@@ -323,7 +324,7 @@ handle_option (struct outp_driver *this,
 	    this->width = arg;
 	    break;
 	  default:
-	    abort ();
+	    NOT_REACHED ();
 	  }
       }
       break;
@@ -365,7 +366,7 @@ handle_option (struct outp_driver *this,
 	    x->tab_width = arg;
 	    break;
 	  default:
-	    abort ();
+	    NOT_REACHED ();
 	  }
       }
       break;
@@ -395,12 +396,12 @@ handle_option (struct outp_driver *this,
             x->squeeze_blank_lines = setting;
             break;
 	  default:
-	    abort ();
+	    NOT_REACHED ();
 	  }
       }
       break;
     default:
-      abort ();
+      NOT_REACHED ();
     }
 
   return true;
@@ -511,7 +512,7 @@ text_draw (struct outp_driver *this,
       x += width - length;
       break;
     default:
-      abort ();
+      NOT_REACHED ();
     }
 
   if (y >= this->length || x >= this->width)
Index: src/output/html.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/output/html.c,v
retrieving revision 1.12
diff -u -p -r1.12 html.c
--- src/output/html.c	3 Jul 2006 17:39:07 -0000	1.12
+++ src/output/html.c	5 Jul 2006 05:00:20 -0000
@@ -27,6 +27,7 @@
 #include <unistd.h>
 
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <data/file-name.h>
 #include "error.h"
@@ -183,11 +184,11 @@ handle_option (struct outp_driver *this,
           error (0, 0, _("`chart-files' value must contain `#'"));
           break;
         default:
-          abort ();
+          NOT_REACHED ();
         }
       break;
     default:
-      abort ();
+      NOT_REACHED ();
     }
   
   return true;
@@ -212,7 +213,7 @@ html_submit (struct outp_driver *this, s
       link_image (x->file, ((struct chart *)s->ext)->file_name);
       break;
     default:
-      abort ();
+      NOT_REACHED ();
     }
 }
 
Index: src/output/manager.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/output/manager.c,v
retrieving revision 1.8
diff -u -p -r1.8 manager.c
--- src/output/manager.c	14 May 2006 20:11:50 -0000	1.8
+++ src/output/manager.c	5 Jul 2006 05:00:21 -0000
@@ -21,6 +21,7 @@
 #include "manager.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <libpspp/assertion.h>
 #include "output.h"
 
 /* Table. */
@@ -110,7 +111,7 @@ som_submit (struct som_entity *t)
 	{
 	  printf ("headers: (l,r)=(%d,%d), (t,b)=(%d,%d) in table size (%d,%d)\n",
 		  hl, hr, ht, hb, nc, nr);
-	  abort ();
+	  NOT_REACHED ();
 	}
       else if (hl + hr == nc)
 	printf ("warning: headers (l,r)=(%d,%d) in table width %d\n", hl, hr, nc);
Index: src/output/postscript.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/output/postscript.c,v
retrieving revision 1.18
diff -u -p -r1.18 postscript.c
--- src/output/postscript.c	9 Jun 2006 22:51:24 -0000	1.18
+++ src/output/postscript.c	5 Jul 2006 05:00:21 -0000
@@ -27,6 +27,7 @@
 #include <unistd.h>
 
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/bit-vector.h>
 #include <libpspp/compiler.h>
 #include <libpspp/freaderror.h>
@@ -374,7 +375,7 @@ handle_option (struct outp_driver *this,
 	    this->font_height = arg;
 	    break;
 	  default:
-	    abort ();
+	    NOT_REACHED ();
 	  }
       }
       break;
@@ -400,7 +401,7 @@ handle_option (struct outp_driver *this,
 	    x->line_width = dimension;
 	    break;
 	  default:
-	    abort ();
+	    NOT_REACHED ();
 	  }
       }
       break;
@@ -417,7 +418,7 @@ handle_option (struct outp_driver *this,
       }
       break;
     default:
-      abort ();
+      NOT_REACHED ();
     }
 
   return true;
@@ -608,8 +609,7 @@ ps_submit (struct outp_driver *this UNUS
     case SOM_CHART:
       break;
     default:
-      abort ();
-      break;
+      NOT_REACHED ();
     }
 }
 
Index: src/output/table.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/output/table.c,v
retrieving revision 1.9
diff -u -p -r1.9 table.c
--- src/output/table.c	2 Jul 2006 05:44:25 -0000	1.9
+++ src/output/table.c	5 Jul 2006 05:00:22 -0000
@@ -24,6 +24,7 @@
 #include <limits.h>
 #include <stdlib.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <data/format.h>
 #include <libpspp/magic.h>
@@ -305,7 +306,7 @@ tab_box (struct tab_table *t, int f_h, i
 	      x2, t->col_ofs, x2 + t->col_ofs,
 	      y2, t->row_ofs, y2 + t->row_ofs,
 	      t->nc, t->nr);
-      abort ();
+      NOT_REACHED ();
     }
 #endif
 
@@ -804,12 +805,12 @@ tab_offset (struct tab_table *t, int col
   if (row < -1 || row >= t->nr)
     {
       printf ("tab_offset(): row=%d in %d-row table\n", row, t->nr);
-      abort ();
+      NOT_REACHED ();
     }
   if (col < -1 || col >= t->nc)
     {
       printf ("tab_offset(): col=%d in %d-column table\n", col, t->nc);
-      abort ();
+      NOT_REACHED ();
     }
 #endif
 
@@ -870,7 +871,7 @@ rule_to_spacing_type (unsigned char type
     case TAL_2:
       return OUTP_L_DOUBLE;
     default:
-      abort ();
+      NOT_REACHED ();
     }
 }
 
@@ -1256,7 +1257,7 @@ translate_justification (unsigned int op
     case TAB_CENTER:
       return OUTP_CENTER;
     default:
-      abort ();
+      NOT_REACHED ();
     }
 }
 
@@ -1275,7 +1276,7 @@ rule_to_draw_type (unsigned char type) 
     case TAL_2:
       return OUTP_L_DOUBLE;
     default:
-      abort ();
+      NOT_REACHED ();
     }
 }
 
Index: src/output/charts/plot-chart.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/output/charts/plot-chart.c,v
retrieving revision 1.3
diff -u -p -r1.3 plot-chart.c
--- src/output/charts/plot-chart.c	4 Apr 2006 12:43:22 -0000	1.3
+++ src/output/charts/plot-chart.c	5 Jul 2006 05:00:23 -0000
@@ -36,6 +36,7 @@
 
 #include <libpspp/str.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <output/manager.h>
 #include <output/output.h>
 
@@ -76,7 +77,7 @@ draw_tick(struct chart *chart, 
   else if (orientation == TICK_ORDINATE ) 
       pl_flinerel_r(chart->lp, 0, position, -tickSize, position);
   else
-    assert(0);
+    NOT_REACHED ();
 
   if ( label ) {
     char buf[10];
Index: src/ui/terminal/command-line.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/ui/terminal/command-line.c,v
retrieving revision 1.5
diff -u -p -r1.5 command-line.c
--- src/ui/terminal/command-line.c	25 Apr 2006 18:03:03 -0000	1.5
+++ src/ui/terminal/command-line.c	5 Jul 2006 05:00:23 -0000
@@ -26,6 +26,7 @@
 #include <getopt.h>
 #include <stdlib.h>
 #include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
 #include <libpspp/copyleft.h>
 #include <libpspp/message.h>
 #include <language/line-buffer.h>
@@ -180,7 +181,7 @@ parse_command_line (int argc, char **arg
 	case 0:
 	  break;
 	default:
-	  assert (0);
+	  NOT_REACHED ();
 	}
     }
 
Index: src/ui/terminal/main.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/ui/terminal/main.c,v
retrieving revision 1.13
diff -u -p -r1.13 main.c
--- src/ui/terminal/main.c	28 Jun 2006 05:49:03 -0000	1.13
+++ src/ui/terminal/main.c	5 Jul 2006 05:00:23 -0000
@@ -75,6 +75,7 @@ void interrupt_handler(int sig);
 int
 main (int argc, char **argv)
 {
+  signal (SIGABRT, bug_handler);
   signal (SIGSEGV, bug_handler);
   signal (SIGFPE, bug_handler);
   signal (SIGINT, interrupt_handler);
@@ -149,15 +150,14 @@ bug_handler(int sig)
 {
   switch (sig) 
     {
+    case SIGABRT:
+      request_bug_report_and_abort("Assertion Failure/Abort");
     case SIGFPE:
       request_bug_report_and_abort("Floating Point Exception");
-      break;
     case SIGSEGV:
       request_bug_report_and_abort("Segmentation Violation");
-      break;
     default:
-      request_bug_report_and_abort("");
-      break;
+      request_bug_report_and_abort("Unknown");
     }
 }
 
