aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2012-06-24 10:39:14 -0700
committerPaul Eggert2012-06-24 10:39:14 -0700
commit845ca893904e4664063cb5c121b34925386849f7 (patch)
tree6d9798a0d167f9e6bb5a2a6dae21c83ad9eb9a74 /lib-src
parent696056c280e0e4a03e12d8d53f692c015ff19217 (diff)
downloademacs-845ca893904e4664063cb5c121b34925386849f7.tar.gz
emacs-845ca893904e4664063cb5c121b34925386849f7.zip
Switch from NO_RETURN to C11's _Noreturn.
Fixes: debbugs:11750
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog15
-rw-r--r--lib-src/ebrowse.c8
-rw-r--r--lib-src/emacsclient.c7
-rw-r--r--lib-src/etags.c6
-rw-r--r--lib-src/hexl.c2
-rw-r--r--lib-src/make-docfile.c3
-rw-r--r--lib-src/movemail.c6
-rw-r--r--lib-src/update-game-score.c12
8 files changed, 31 insertions, 28 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index e3232a46f3c..a573cd88d10 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,18 @@
12012-06-24 Paul Eggert <eggert@cs.ucla.edu>
2
3 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4 * ebrowse.c (usage, version):
5 * emacsclient.c (print_help_and_exit, fail):
6 * etags.c (suggest_asking_for_help, fatal, pfatal):
7 * hexl.c (usage):
8 * make-docfile.c (fatal):
9 * movemail.c (fatal, pfatal_with_name, pfatal_and_delete):
10 * update-game-score.c (usage):
11 * ebrowse.c (usage, version):
12 * emacsclient.c (print_help_and_exit, fail):
13 Use _Noreturn rather than NO_RETURN.
14 No need for separate decl merely because of _Noreturn.
15
12012-06-24 Samuel Bronson <naesten@gmail.com> (tiny change) 162012-06-24 Samuel Bronson <naesten@gmail.com> (tiny change)
2 17
3 * emacsclient.c (set_local_socket): Fix compiler warning (Bug#7838). 18 * emacsclient.c (set_local_socket): Fix compiler warning (Bug#7838).
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index a1fe10b863a..1c43bc6a4f1 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -463,10 +463,6 @@ static struct member *add_member (struct sym *, char *, int, int, unsigned);
463static void class_definition (struct sym *, int, int, int); 463static void class_definition (struct sym *, int, int, int);
464static char *operator_name (int *); 464static char *operator_name (int *);
465static void parse_qualified_param_ident_or_type (char **); 465static void parse_qualified_param_ident_or_type (char **);
466static void usage (int) NO_RETURN;
467static void version (void) NO_RETURN;
468
469
470 466
471/*********************************************************************** 467/***********************************************************************
472 Utilities 468 Utilities
@@ -3507,7 +3503,7 @@ Usage: ebrowse [options] {files}\n\
3507 --version display version info\n\ 3503 --version display version info\n\
3508" 3504"
3509 3505
3510static void 3506static _Noreturn void
3511usage (int error) 3507usage (int error)
3512{ 3508{
3513 puts (USAGE); 3509 puts (USAGE);
@@ -3522,7 +3518,7 @@ usage (int error)
3522# define VERSION "21" 3518# define VERSION "21"
3523#endif 3519#endif
3524 3520
3525static void 3521static _Noreturn void
3526version (void) 3522version (void)
3527{ 3523{
3528 /* Makes it easier to update automatically. */ 3524 /* Makes it easier to update automatically. */
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index f8e81256101..94cfa85d3f1 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -169,8 +169,7 @@ int emacs_pid = 0;
169 be used for the new frame */ 169 be used for the new frame */
170const char *frame_parameters = NULL; 170const char *frame_parameters = NULL;
171 171
172static void print_help_and_exit (void) NO_RETURN; 172static _Noreturn void print_help_and_exit (void);
173static void fail (void) NO_RETURN;
174 173
175 174
176struct option longopts[] = 175struct option longopts[] =
@@ -670,7 +669,7 @@ an empty string");
670} 669}
671 670
672 671
673static void 672static _Noreturn void
674print_help_and_exit (void) 673print_help_and_exit (void)
675{ 674{
676 /* Spaces and tabs are significant in this message; they're chosen so the 675 /* Spaces and tabs are significant in this message; they're chosen so the
@@ -718,7 +717,7 @@ Report bugs with M-x report-emacs-bug.\n", progname);
718 defined-- exit with an errorcode. 717 defined-- exit with an errorcode.
719 Uses argv, but gets it from the global variable main_argv. 718 Uses argv, but gets it from the global variable main_argv.
720*/ 719*/
721static void 720static _Noreturn void
722fail (void) 721fail (void)
723{ 722{
724 if (alternate_editor) 723 if (alternate_editor)
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 7d2a5a90999..71f153163ef 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -366,9 +366,9 @@ static void analyse_regex (char *);
366static void free_regexps (void); 366static void free_regexps (void);
367static void regex_tag_multiline (void); 367static void regex_tag_multiline (void);
368static void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); 368static void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
369static void suggest_asking_for_help (void) NO_RETURN; 369static _Noreturn void suggest_asking_for_help (void);
370void fatal (const char *, const char *) NO_RETURN; 370_Noreturn void fatal (const char *, const char *);
371static void pfatal (const char *) NO_RETURN; 371static _Noreturn void pfatal (const char *);
372static void add_node (node *, node **); 372static void add_node (node *, node **);
373 373
374static void init (void); 374static void init (void);
diff --git a/lib-src/hexl.c b/lib-src/hexl.c
index f8fb11f8218..d418eca78c2 100644
--- a/lib-src/hexl.c
+++ b/lib-src/hexl.c
@@ -48,7 +48,7 @@ int base = DEFAULT_BASE, un_flag = FALSE, iso_flag = FALSE, endian = 1;
48int group_by = DEFAULT_GROUPING; 48int group_by = DEFAULT_GROUPING;
49char *progname; 49char *progname;
50 50
51void usage (void) NO_RETURN; 51_Noreturn void usage (void);
52 52
53int 53int
54main (int argc, char **argv) 54main (int argc, char **argv)
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 4f68fdb78c9..8156db9b73a 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -76,7 +76,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
76static int scan_file (char *filename); 76static int scan_file (char *filename);
77static int scan_lisp_file (const char *filename, const char *mode); 77static int scan_lisp_file (const char *filename, const char *mode);
78static int scan_c_file (char *filename, const char *mode); 78static int scan_c_file (char *filename, const char *mode);
79static void fatal (const char *s1, const char *s2) NO_RETURN;
80static void start_globals (void); 79static void start_globals (void);
81static void write_globals (void); 80static void write_globals (void);
82 81
@@ -111,7 +110,7 @@ error (const char *s1, const char *s2)
111/* Print error message and exit. */ 110/* Print error message and exit. */
112 111
113/* VARARGS1 */ 112/* VARARGS1 */
114static void 113static _Noreturn void
115fatal (const char *s1, const char *s2) 114fatal (const char *s1, const char *s2)
116{ 115{
117 error (s1, s2); 116 error (s1, s2);
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 9d19df32814..3d994ec5a5e 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -137,10 +137,10 @@ static char *mail_spool_name (char *);
137char *strerror (int); 137char *strerror (int);
138#endif 138#endif
139 139
140static void fatal (const char *s1, const char *s2, const char *s3) NO_RETURN; 140static _Noreturn void fatal (const char *s1, const char *s2, const char *s3);
141static void error (const char *s1, const char *s2, const char *s3); 141static void error (const char *s1, const char *s2, const char *s3);
142static void pfatal_with_name (char *name) NO_RETURN; 142static _Noreturn void pfatal_with_name (char *name);
143static void pfatal_and_delete (char *name) NO_RETURN; 143static _Noreturn void pfatal_and_delete (char *name);
144static char *concat (const char *s1, const char *s2, const char *s3); 144static char *concat (const char *s1, const char *s2, const char *s3);
145static long *xmalloc (unsigned int size); 145static long *xmalloc (unsigned int size);
146#ifdef MAIL_USE_POP 146#ifdef MAIL_USE_POP
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index e0c940510be..94de662e589 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -48,8 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
48#include <sys/stat.h> 48#include <sys/stat.h>
49#include <getopt.h> 49#include <getopt.h>
50 50
51static int usage (int err) NO_RETURN;
52
53#define MAX_ATTEMPTS 5 51#define MAX_ATTEMPTS 5
54#define MAX_SCORES 200 52#define MAX_SCORES 200
55#define MAX_DATA_LEN 1024 53#define MAX_DATA_LEN 1024
@@ -59,7 +57,7 @@ static int usage (int err) NO_RETURN;
59#define difftime(t1, t0) (double)((t1) - (t0)) 57#define difftime(t1, t0) (double)((t1) - (t0))
60#endif 58#endif
61 59
62static int 60static _Noreturn void
63usage (int err) 61usage (int err)
64{ 62{
65 fprintf (stdout, "Usage: update-game-score [-m MAX] [-r] [-d DIR] game/scorefile SCORE DATA\n"); 63 fprintf (stdout, "Usage: update-game-score [-m MAX] [-r] [-d DIR] game/scorefile SCORE DATA\n");
@@ -89,17 +87,13 @@ static void sort_scores (struct score_entry *scores, int count, int reverse);
89static int write_scores (const char *filename, 87static int write_scores (const char *filename,
90 const struct score_entry *scores, int count); 88 const struct score_entry *scores, int count);
91 89
92static void lose (const char *msg) NO_RETURN; 90static _Noreturn void
93
94static void
95lose (const char *msg) 91lose (const char *msg)
96{ 92{
97 fprintf (stderr, "%s\n", msg); 93 fprintf (stderr, "%s\n", msg);
98 exit (EXIT_FAILURE); 94 exit (EXIT_FAILURE);
99} 95}
100 96
101static void lose_syserr (const char *msg) NO_RETURN;
102
103/* Taken from sysdep.c. */ 97/* Taken from sysdep.c. */
104#ifndef HAVE_STRERROR 98#ifndef HAVE_STRERROR
105#ifndef WINDOWSNT 99#ifndef WINDOWSNT
@@ -116,7 +110,7 @@ strerror (int errnum)
116#endif /* not WINDOWSNT */ 110#endif /* not WINDOWSNT */
117#endif /* ! HAVE_STRERROR */ 111#endif /* ! HAVE_STRERROR */
118 112
119static void 113static _Noreturn void
120lose_syserr (const char *msg) 114lose_syserr (const char *msg)
121{ 115{
122 fprintf (stderr, "%s: %s\n", msg, strerror (errno)); 116 fprintf (stderr, "%s: %s\n", msg, strerror (errno));