diff options
| author | Paul Eggert | 2013-03-13 00:27:34 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-03-13 00:27:34 -0700 |
| commit | d9df6f40e326f3f5487b7c50b99bf5112262badc (patch) | |
| tree | 7926ff98290d937c28969a66e1f37b7bf0a3ffe2 /src | |
| parent | 2c3f72f4b5f7d00cf0131998957c24812c8f6a53 (diff) | |
| download | emacs-d9df6f40e326f3f5487b7c50b99bf5112262badc.tar.gz emacs-d9df6f40e326f3f5487b7c50b99bf5112262badc.zip | |
Static checking by Sun C 5.12.
* lib-src/etags.c (analyse_regex): Omit unreachable code.
* src/alloc.c (buffer_memory_full) [REL_ALLOC]:
* src/bytecode.c (exec_byte_code):
* src/dispnew.c (init_display):
* src/eval.c (error):
* src/fileio.c (Fsubstitute_in_file_name):
* src/keyboard.c (Fevent_convert_list):
* src/keymap.c (Fsingle_key_description):
* src/term.c (maybe_fatal, fatal):
* src/xfns.c (Fx_display_backing_store, Fx_display_visual_class):
* src/xsmfns.c (Fhandle_save_session):
Omit unreachable code.
* src/keymap.c (map_keymap_char_table_item): Cast void * to
a function pointer type; the C Standard requires this.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 15 | ||||
| -rw-r--r-- | src/alloc.c | 4 | ||||
| -rw-r--r-- | src/bytecode.c | 2 | ||||
| -rw-r--r-- | src/dispnew.c | 5 | ||||
| -rw-r--r-- | src/eval.c | 1 | ||||
| -rw-r--r-- | src/fileio.c | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 5 | ||||
| -rw-r--r-- | src/keymap.c | 4 | ||||
| -rw-r--r-- | src/term.c | 4 | ||||
| -rw-r--r-- | src/xfns.c | 2 | ||||
| -rw-r--r-- | src/xsmfns.c | 2 |
11 files changed, 23 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c0e6bd93fd0..7642393bb01 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,20 @@ | |||
| 1 | 2013-03-13 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2013-03-13 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Static checking by Sun C 5.12. | ||
| 4 | * alloc.c (buffer_memory_full) [REL_ALLOC]: | ||
| 5 | * bytecode.c (exec_byte_code): | ||
| 6 | * dispnew.c (init_display): | ||
| 7 | * eval.c (error): | ||
| 8 | * fileio.c (Fsubstitute_in_file_name): | ||
| 9 | * keyboard.c (Fevent_convert_list): | ||
| 10 | * keymap.c (Fsingle_key_description): | ||
| 11 | * term.c (maybe_fatal, fatal): | ||
| 12 | * xfns.c (Fx_display_backing_store, Fx_display_visual_class): | ||
| 13 | * xsmfns.c (Fhandle_save_session): | ||
| 14 | Omit unreachable code. | ||
| 15 | * keymap.c (map_keymap_char_table_item): Cast void * to | ||
| 16 | a function pointer type; the C Standard requires this. | ||
| 17 | |||
| 3 | * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out. | 18 | * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out. |
| 4 | Include <sys/param.h> unconditionally, as that works elsewhere and | 19 | Include <sys/param.h> unconditionally, as that works elsewhere and |
| 5 | is simpler here. Include <sys/sysctl.h> if DARWIN_OS || | 20 | is simpler here. Include <sys/sysctl.h> if DARWIN_OS || |
diff --git a/src/alloc.c b/src/alloc.c index 80086433e65..b2703c5f961 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -422,11 +422,11 @@ buffer_memory_full (ptrdiff_t nbytes) | |||
| 422 | 422 | ||
| 423 | #ifndef REL_ALLOC | 423 | #ifndef REL_ALLOC |
| 424 | memory_full (nbytes); | 424 | memory_full (nbytes); |
| 425 | #endif | 425 | #else |
| 426 | |||
| 427 | /* This used to call error, but if we've run out of memory, we could | 426 | /* This used to call error, but if we've run out of memory, we could |
| 428 | get infinite recursion trying to build the string. */ | 427 | get infinite recursion trying to build the string. */ |
| 429 | xsignal (Qnil, Vmemory_signal_data); | 428 | xsignal (Qnil, Vmemory_signal_data); |
| 429 | #endif | ||
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | /* A common multiple of the positive integers A and B. Ideally this | 432 | /* A common multiple of the positive integers A and B. Ideally this |
diff --git a/src/bytecode.c b/src/bytecode.c index 628c4d90cf3..acb96c1e61b 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -755,7 +755,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 755 | { | 755 | { |
| 756 | BEFORE_POTENTIAL_GC (); | 756 | BEFORE_POTENTIAL_GC (); |
| 757 | wrong_type_argument (Qlistp, v1); | 757 | wrong_type_argument (Qlistp, v1); |
| 758 | AFTER_POTENTIAL_GC (); | ||
| 759 | } | 758 | } |
| 760 | NEXT; | 759 | NEXT; |
| 761 | } | 760 | } |
| @@ -790,7 +789,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 790 | { | 789 | { |
| 791 | BEFORE_POTENTIAL_GC (); | 790 | BEFORE_POTENTIAL_GC (); |
| 792 | wrong_type_argument (Qlistp, v1); | 791 | wrong_type_argument (Qlistp, v1); |
| 793 | AFTER_POTENTIAL_GC (); | ||
| 794 | } | 792 | } |
| 795 | NEXT; | 793 | NEXT; |
| 796 | } | 794 | } |
diff --git a/src/dispnew.c b/src/dispnew.c index 9335365bc71..47adab6b8f7 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -6100,10 +6100,7 @@ init_display (void) | |||
| 6100 | 6100 | ||
| 6101 | /* If no window system has been specified, try to use the terminal. */ | 6101 | /* If no window system has been specified, try to use the terminal. */ |
| 6102 | if (! isatty (0)) | 6102 | if (! isatty (0)) |
| 6103 | { | 6103 | fatal ("standard input is not a tty"); |
| 6104 | fatal ("standard input is not a tty"); | ||
| 6105 | exit (1); | ||
| 6106 | } | ||
| 6107 | 6104 | ||
| 6108 | #ifdef WINDOWSNT | 6105 | #ifdef WINDOWSNT |
| 6109 | terminal_type = "w32console"; | 6106 | terminal_type = "w32console"; |
diff --git a/src/eval.c b/src/eval.c index 5db6f9d0bf3..69483a9b205 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1690,7 +1690,6 @@ error (const char *m, ...) | |||
| 1690 | va_list ap; | 1690 | va_list ap; |
| 1691 | va_start (ap, m); | 1691 | va_start (ap, m); |
| 1692 | verror (m, ap); | 1692 | verror (m, ap); |
| 1693 | va_end (ap); | ||
| 1694 | } | 1693 | } |
| 1695 | 1694 | ||
| 1696 | DEFUN ("commandp", Fcommandp, Scommandp, 1, 2, 0, | 1695 | DEFUN ("commandp", Fcommandp, Scommandp, 1, 2, 0, |
diff --git a/src/fileio.c b/src/fileio.c index d7363077b35..8937f7ca477 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1850,9 +1850,6 @@ those `/' is discarded. */) | |||
| 1850 | error ("Missing \"}\" in environment-variable substitution"); | 1850 | error ("Missing \"}\" in environment-variable substitution"); |
| 1851 | badvar: | 1851 | badvar: |
| 1852 | error ("Substituting nonexistent environment variable \"%s\"", target); | 1852 | error ("Substituting nonexistent environment variable \"%s\"", target); |
| 1853 | |||
| 1854 | /* NOTREACHED */ | ||
| 1855 | return Qnil; | ||
| 1856 | } | 1853 | } |
| 1857 | 1854 | ||
| 1858 | /* A slightly faster and more convenient way to get | 1855 | /* A slightly faster and more convenient way to get |
| @@ -3305,7 +3302,6 @@ Use the current time if TIMESTAMP is nil. TIMESTAMP is in the format of | |||
| 3305 | return Qnil; | 3302 | return Qnil; |
| 3306 | #endif | 3303 | #endif |
| 3307 | report_file_error ("Setting file times", Fcons (absname, Qnil)); | 3304 | report_file_error ("Setting file times", Fcons (absname, Qnil)); |
| 3308 | return Qnil; | ||
| 3309 | } | 3305 | } |
| 3310 | } | 3306 | } |
| 3311 | 3307 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index fe8b45a0130..e43b7a73172 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -6552,10 +6552,7 @@ has the same base event type and all the specified modifiers. */) | |||
| 6552 | else if (SYMBOLP (base)) | 6552 | else if (SYMBOLP (base)) |
| 6553 | return apply_modifiers (modifiers, base); | 6553 | return apply_modifiers (modifiers, base); |
| 6554 | else | 6554 | else |
| 6555 | { | 6555 | error ("Invalid base event"); |
| 6556 | error ("Invalid base event"); | ||
| 6557 | return Qnil; | ||
| 6558 | } | ||
| 6559 | } | 6556 | } |
| 6560 | 6557 | ||
| 6561 | /* Try to recognize SYMBOL as a modifier name. | 6558 | /* Try to recognize SYMBOL as a modifier name. |
diff --git a/src/keymap.c b/src/keymap.c index 922c1703edf..00eefb375ef 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -565,7 +565,8 @@ map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val) | |||
| 565 | { | 565 | { |
| 566 | if (!NILP (val)) | 566 | if (!NILP (val)) |
| 567 | { | 567 | { |
| 568 | map_keymap_function_t fun = XSAVE_POINTER (args, 0); | 568 | map_keymap_function_t fun |
| 569 | = (map_keymap_function_t) XSAVE_POINTER (args, 0); | ||
| 569 | /* If the key is a range, make a copy since map_char_table modifies | 570 | /* If the key is a range, make a copy since map_char_table modifies |
| 570 | it in place. */ | 571 | it in place. */ |
| 571 | if (CONSP (key)) | 572 | if (CONSP (key)) |
| @@ -2310,7 +2311,6 @@ around function keys and event symbols. */) | |||
| 2310 | return Fcopy_sequence (key); | 2311 | return Fcopy_sequence (key); |
| 2311 | else | 2312 | else |
| 2312 | error ("KEY must be an integer, cons, symbol, or string"); | 2313 | error ("KEY must be an integer, cons, symbol, or string"); |
| 2313 | return Qnil; | ||
| 2314 | } | 2314 | } |
| 2315 | 2315 | ||
| 2316 | static char * | 2316 | static char * |
diff --git a/src/term.c b/src/term.c index 822b74aa44e..38706602a02 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -3426,9 +3426,6 @@ maybe_fatal (int must_succeed, struct terminal *terminal, | |||
| 3426 | vfatal (str2, ap); | 3426 | vfatal (str2, ap); |
| 3427 | else | 3427 | else |
| 3428 | verror (str1, ap); | 3428 | verror (str1, ap); |
| 3429 | |||
| 3430 | va_end (ap); | ||
| 3431 | emacs_abort (); | ||
| 3432 | } | 3429 | } |
| 3433 | 3430 | ||
| 3434 | void | 3431 | void |
| @@ -3437,7 +3434,6 @@ fatal (const char *str, ...) | |||
| 3437 | va_list ap; | 3434 | va_list ap; |
| 3438 | va_start (ap, str); | 3435 | va_start (ap, str); |
| 3439 | vfatal (str, ap); | 3436 | vfatal (str, ap); |
| 3440 | va_end (ap); | ||
| 3441 | } | 3437 | } |
| 3442 | 3438 | ||
| 3443 | 3439 | ||
diff --git a/src/xfns.c b/src/xfns.c index a6a56c8c5e1..100fd81a155 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -3769,7 +3769,6 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3769 | 3769 | ||
| 3770 | default: | 3770 | default: |
| 3771 | error ("Strange value for BackingStore parameter of screen"); | 3771 | error ("Strange value for BackingStore parameter of screen"); |
| 3772 | result = Qnil; | ||
| 3773 | } | 3772 | } |
| 3774 | 3773 | ||
| 3775 | return result; | 3774 | return result; |
| @@ -3811,7 +3810,6 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3811 | break; | 3810 | break; |
| 3812 | default: | 3811 | default: |
| 3813 | error ("Display has an unknown visual class"); | 3812 | error ("Display has an unknown visual class"); |
| 3814 | result = Qnil; | ||
| 3815 | } | 3813 | } |
| 3816 | 3814 | ||
| 3817 | return result; | 3815 | return result; |
diff --git a/src/xsmfns.c b/src/xsmfns.c index fe2dfbaf83e..cb7122202df 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c | |||
| @@ -514,9 +514,11 @@ Do not call this function yourself. */) | |||
| 514 | prevent. Fix this in next version. */ | 514 | prevent. Fix this in next version. */ |
| 515 | Fkill_emacs (Qnil); | 515 | Fkill_emacs (Qnil); |
| 516 | 516 | ||
| 517 | #if 0 | ||
| 517 | /* This will not be reached, but we want kill-emacs-hook to be run. */ | 518 | /* This will not be reached, but we want kill-emacs-hook to be run. */ |
| 518 | SmcCloseConnection (smc_conn, 0, 0); | 519 | SmcCloseConnection (smc_conn, 0, 0); |
| 519 | ice_connection_closed (); | 520 | ice_connection_closed (); |
| 521 | #endif | ||
| 520 | } | 522 | } |
| 521 | 523 | ||
| 522 | return Qnil; | 524 | return Qnil; |