diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-06-24 10:39:14 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-06-24 10:39:14 -0700 |
commit | 845ca893904e4664063cb5c121b34925386849f7 (patch) | |
tree | 6d9798a0d167f9e6bb5a2a6dae21c83ad9eb9a74 /lib-src | |
parent | 696056c280e0e4a03e12d8d53f692c015ff19217 (diff) | |
download | emacs-845ca893904e4664063cb5c121b34925386849f7.tar.gz emacs-845ca893904e4664063cb5c121b34925386849f7.tar.bz2 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 @@ +2012-06-24 Paul Eggert <eggert@cs.ucla.edu> + + Switch from NO_RETURN to C11's _Noreturn (Bug#11750). + * ebrowse.c (usage, version): + * emacsclient.c (print_help_and_exit, fail): + * etags.c (suggest_asking_for_help, fatal, pfatal): + * hexl.c (usage): + * make-docfile.c (fatal): + * movemail.c (fatal, pfatal_with_name, pfatal_and_delete): + * update-game-score.c (usage): + * ebrowse.c (usage, version): + * emacsclient.c (print_help_and_exit, fail): + Use _Noreturn rather than NO_RETURN. + No need for separate decl merely because of _Noreturn. + 2012-06-24 Samuel Bronson <naesten@gmail.com> (tiny change) * 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); static void class_definition (struct sym *, int, int, int); static char *operator_name (int *); static void parse_qualified_param_ident_or_type (char **); -static void usage (int) NO_RETURN; -static void version (void) NO_RETURN; - - /*********************************************************************** Utilities @@ -3507,7 +3503,7 @@ Usage: ebrowse [options] {files}\n\ --version display version info\n\ " -static void +static _Noreturn void usage (int error) { puts (USAGE); @@ -3522,7 +3518,7 @@ usage (int error) # define VERSION "21" #endif -static void +static _Noreturn void version (void) { /* 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; be used for the new frame */ const char *frame_parameters = NULL; -static void print_help_and_exit (void) NO_RETURN; -static void fail (void) NO_RETURN; +static _Noreturn void print_help_and_exit (void); struct option longopts[] = @@ -670,7 +669,7 @@ an empty string"); } -static void +static _Noreturn void print_help_and_exit (void) { /* 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); defined-- exit with an errorcode. Uses argv, but gets it from the global variable main_argv. */ -static void +static _Noreturn void fail (void) { 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 *); static void free_regexps (void); static void regex_tag_multiline (void); static void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); -static void suggest_asking_for_help (void) NO_RETURN; -void fatal (const char *, const char *) NO_RETURN; -static void pfatal (const char *) NO_RETURN; +static _Noreturn void suggest_asking_for_help (void); +_Noreturn void fatal (const char *, const char *); +static _Noreturn void pfatal (const char *); static void add_node (node *, node **); 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; int group_by = DEFAULT_GROUPING; char *progname; -void usage (void) NO_RETURN; +_Noreturn void usage (void); int 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/>. */ static int scan_file (char *filename); static int scan_lisp_file (const char *filename, const char *mode); static int scan_c_file (char *filename, const char *mode); -static void fatal (const char *s1, const char *s2) NO_RETURN; static void start_globals (void); static void write_globals (void); @@ -111,7 +110,7 @@ error (const char *s1, const char *s2) /* Print error message and exit. */ /* VARARGS1 */ -static void +static _Noreturn void fatal (const char *s1, const char *s2) { 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 *); char *strerror (int); #endif -static void fatal (const char *s1, const char *s2, const char *s3) NO_RETURN; +static _Noreturn void fatal (const char *s1, const char *s2, const char *s3); static void error (const char *s1, const char *s2, const char *s3); -static void pfatal_with_name (char *name) NO_RETURN; -static void pfatal_and_delete (char *name) NO_RETURN; +static _Noreturn void pfatal_with_name (char *name); +static _Noreturn void pfatal_and_delete (char *name); static char *concat (const char *s1, const char *s2, const char *s3); static long *xmalloc (unsigned int size); #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/>. */ #include <sys/stat.h> #include <getopt.h> -static int usage (int err) NO_RETURN; - #define MAX_ATTEMPTS 5 #define MAX_SCORES 200 #define MAX_DATA_LEN 1024 @@ -59,7 +57,7 @@ static int usage (int err) NO_RETURN; #define difftime(t1, t0) (double)((t1) - (t0)) #endif -static int +static _Noreturn void usage (int err) { 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); static int write_scores (const char *filename, const struct score_entry *scores, int count); -static void lose (const char *msg) NO_RETURN; - -static void +static _Noreturn void lose (const char *msg) { fprintf (stderr, "%s\n", msg); exit (EXIT_FAILURE); } -static void lose_syserr (const char *msg) NO_RETURN; - /* Taken from sysdep.c. */ #ifndef HAVE_STRERROR #ifndef WINDOWSNT @@ -116,7 +110,7 @@ strerror (int errnum) #endif /* not WINDOWSNT */ #endif /* ! HAVE_STRERROR */ -static void +static _Noreturn void lose_syserr (const char *msg) { fprintf (stderr, "%s: %s\n", msg, strerror (errno)); |