aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2019-08-31 10:35:08 -0700
committerPaul Eggert2019-08-31 11:01:46 -0700
commit7791005544836f93542e8277ad5897f8f5920f05 (patch)
treeb0c93947951d98f1af820b33094374ddd1658188 /src
parent2de46be6620174e6e2cf4ed397e7cf901d1f1a7a (diff)
downloademacs-7791005544836f93542e8277ad5897f8f5920f05.tar.gz
emacs-7791005544836f93542e8277ad5897f8f5920f05.zip
Check instead of relying on NOTREACHED
NOTREACHED was designed for traditional lint decades ago, and _Noreturn now normally subsumes its function. In the one case in Emacs where NORETURN might help and _Noreturn does not, check for NOTREACHED instead of assuming it. * lib-src/etags.c (main): * src/xterm.c (x_connection_closed): Remove NOTREACHED after a call to a _Noreturn function, as NOTREACHED is no longer needed there. Also, one of the NOTREACHEDs was misplaced, which defeated traditional lint checking anyway. * lib-src/pop.c (pop_getline): Redo so as to not need NOTREACHED. * src/emacs.c (main): Use eassume (false) rather than NOTREACHED, so that running with ENABLE_CHECKING catches any internal error causing the toplevel Frecursive_edit to return.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c3
-rw-r--r--src/xterm.c1
2 files changed, 1 insertions, 3 deletions
diff --git a/src/emacs.c b/src/emacs.c
index cc5818393a3..53572d7f0c8 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2084,8 +2084,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
2084 2084
2085 /* Enter editor command loop. This never returns. */ 2085 /* Enter editor command loop. This never returns. */
2086 Frecursive_edit (); 2086 Frecursive_edit ();
2087 /* NOTREACHED */ 2087 eassume (false);
2088 return 0;
2089} 2088}
2090 2089
2091/* Sort the args so we can find the most important ones 2090/* Sort the args so we can find the most important ones
diff --git a/src/xterm.c b/src/xterm.c
index 0d224063d76..b761eaf4d11 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10044,7 +10044,6 @@ For details, see etc/PROBLEMS.\n",
10044 { 10044 {
10045 fprintf (stderr, "%s\n", error_msg); 10045 fprintf (stderr, "%s\n", error_msg);
10046 Fkill_emacs (make_fixnum (70)); 10046 Fkill_emacs (make_fixnum (70));
10047 /* NOTREACHED */
10048 } 10047 }
10049 10048
10050 totally_unblock_input (); 10049 totally_unblock_input ();