diff options
| author | Paul Eggert | 2012-06-24 10:39:14 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-06-24 10:39:14 -0700 |
| commit | 845ca893904e4664063cb5c121b34925386849f7 (patch) | |
| tree | 6d9798a0d167f9e6bb5a2a6dae21c83ad9eb9a74 /lib-src | |
| parent | 696056c280e0e4a03e12d8d53f692c015ff19217 (diff) | |
| download | emacs-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/ChangeLog | 15 | ||||
| -rw-r--r-- | lib-src/ebrowse.c | 8 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 7 | ||||
| -rw-r--r-- | lib-src/etags.c | 6 | ||||
| -rw-r--r-- | lib-src/hexl.c | 2 | ||||
| -rw-r--r-- | lib-src/make-docfile.c | 3 | ||||
| -rw-r--r-- | lib-src/movemail.c | 6 | ||||
| -rw-r--r-- | lib-src/update-game-score.c | 12 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-06-24 Samuel Bronson <naesten@gmail.com> (tiny change) | 16 | 2012-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); | |||
| 463 | static void class_definition (struct sym *, int, int, int); | 463 | static void class_definition (struct sym *, int, int, int); |
| 464 | static char *operator_name (int *); | 464 | static char *operator_name (int *); |
| 465 | static void parse_qualified_param_ident_or_type (char **); | 465 | static void parse_qualified_param_ident_or_type (char **); |
| 466 | static void usage (int) NO_RETURN; | ||
| 467 | static 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 | ||
| 3510 | static void | 3506 | static _Noreturn void |
| 3511 | usage (int error) | 3507 | usage (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 | ||
| 3525 | static void | 3521 | static _Noreturn void |
| 3526 | version (void) | 3522 | version (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 */ |
| 170 | const char *frame_parameters = NULL; | 170 | const char *frame_parameters = NULL; |
| 171 | 171 | ||
| 172 | static void print_help_and_exit (void) NO_RETURN; | 172 | static _Noreturn void print_help_and_exit (void); |
| 173 | static void fail (void) NO_RETURN; | ||
| 174 | 173 | ||
| 175 | 174 | ||
| 176 | struct option longopts[] = | 175 | struct option longopts[] = |
| @@ -670,7 +669,7 @@ an empty string"); | |||
| 670 | } | 669 | } |
| 671 | 670 | ||
| 672 | 671 | ||
| 673 | static void | 672 | static _Noreturn void |
| 674 | print_help_and_exit (void) | 673 | print_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 | */ |
| 721 | static void | 720 | static _Noreturn void |
| 722 | fail (void) | 721 | fail (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 *); | |||
| 366 | static void free_regexps (void); | 366 | static void free_regexps (void); |
| 367 | static void regex_tag_multiline (void); | 367 | static void regex_tag_multiline (void); |
| 368 | static void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); | 368 | static void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); |
| 369 | static void suggest_asking_for_help (void) NO_RETURN; | 369 | static _Noreturn void suggest_asking_for_help (void); |
| 370 | void fatal (const char *, const char *) NO_RETURN; | 370 | _Noreturn void fatal (const char *, const char *); |
| 371 | static void pfatal (const char *) NO_RETURN; | 371 | static _Noreturn void pfatal (const char *); |
| 372 | static void add_node (node *, node **); | 372 | static void add_node (node *, node **); |
| 373 | 373 | ||
| 374 | static void init (void); | 374 | static 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; | |||
| 48 | int group_by = DEFAULT_GROUPING; | 48 | int group_by = DEFAULT_GROUPING; |
| 49 | char *progname; | 49 | char *progname; |
| 50 | 50 | ||
| 51 | void usage (void) NO_RETURN; | 51 | _Noreturn void usage (void); |
| 52 | 52 | ||
| 53 | int | 53 | int |
| 54 | main (int argc, char **argv) | 54 | main (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/>. */ | |||
| 76 | static int scan_file (char *filename); | 76 | static int scan_file (char *filename); |
| 77 | static int scan_lisp_file (const char *filename, const char *mode); | 77 | static int scan_lisp_file (const char *filename, const char *mode); |
| 78 | static int scan_c_file (char *filename, const char *mode); | 78 | static int scan_c_file (char *filename, const char *mode); |
| 79 | static void fatal (const char *s1, const char *s2) NO_RETURN; | ||
| 80 | static void start_globals (void); | 79 | static void start_globals (void); |
| 81 | static void write_globals (void); | 80 | static 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 */ |
| 114 | static void | 113 | static _Noreturn void |
| 115 | fatal (const char *s1, const char *s2) | 114 | fatal (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 *); | |||
| 137 | char *strerror (int); | 137 | char *strerror (int); |
| 138 | #endif | 138 | #endif |
| 139 | 139 | ||
| 140 | static void fatal (const char *s1, const char *s2, const char *s3) NO_RETURN; | 140 | static _Noreturn void fatal (const char *s1, const char *s2, const char *s3); |
| 141 | static void error (const char *s1, const char *s2, const char *s3); | 141 | static void error (const char *s1, const char *s2, const char *s3); |
| 142 | static void pfatal_with_name (char *name) NO_RETURN; | 142 | static _Noreturn void pfatal_with_name (char *name); |
| 143 | static void pfatal_and_delete (char *name) NO_RETURN; | 143 | static _Noreturn void pfatal_and_delete (char *name); |
| 144 | static char *concat (const char *s1, const char *s2, const char *s3); | 144 | static char *concat (const char *s1, const char *s2, const char *s3); |
| 145 | static long *xmalloc (unsigned int size); | 145 | static 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 | ||
| 51 | static 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 | ||
| 62 | static int | 60 | static _Noreturn void |
| 63 | usage (int err) | 61 | usage (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); | |||
| 89 | static int write_scores (const char *filename, | 87 | static int write_scores (const char *filename, |
| 90 | const struct score_entry *scores, int count); | 88 | const struct score_entry *scores, int count); |
| 91 | 89 | ||
| 92 | static void lose (const char *msg) NO_RETURN; | 90 | static _Noreturn void |
| 93 | |||
| 94 | static void | ||
| 95 | lose (const char *msg) | 91 | lose (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 | ||
| 101 | static 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 | ||
| 119 | static void | 113 | static _Noreturn void |
| 120 | lose_syserr (const char *msg) | 114 | lose_syserr (const char *msg) |
| 121 | { | 115 | { |
| 122 | fprintf (stderr, "%s: %s\n", msg, strerror (errno)); | 116 | fprintf (stderr, "%s: %s\n", msg, strerror (errno)); |