comparison src/eval.c @ 2268:61855263cb07

[xemacs-hg @ 2004-09-14 14:32:29 by james] Identify functions that don't return, including some DEFUNs.
author james
date Tue, 14 Sep 2004 14:33:07 +0000
parents 5753220a0f80
children 04bc9d2f42c7
comparison
equal deleted inserted replaced
2267:5753220a0f80 2268:61855263cb07
1547 some static info saved in CATCH, and longjmp to the location 1547 some static info saved in CATCH, and longjmp to the location
1548 specified in the 1548 specified in the
1549 1549
1550 This is used for correct unwinding in Fthrow and Fsignal. */ 1550 This is used for correct unwinding in Fthrow and Fsignal. */
1551 1551
1552 static void 1552 static DECLARE_DOESNT_RETURN (unwind_to_catch (struct catchtag *, Lisp_Object,
1553 Lisp_Object));
1554
1555 static DOESNT_RETURN
1553 unwind_to_catch (struct catchtag *c, Lisp_Object val, Lisp_Object tag) 1556 unwind_to_catch (struct catchtag *c, Lisp_Object val, Lisp_Object tag)
1554 { 1557 {
1555 REGISTER int last_time; 1558 REGISTER int last_time;
1556 1559
1557 /* Unwind the specbind, catch, and handler stacks back to CATCH 1560 /* Unwind the specbind, catch, and handler stacks back to CATCH
1627 #ifdef DEFEND_AGAINST_THROW_RECURSION 1630 #ifdef DEFEND_AGAINST_THROW_RECURSION
1628 throw_level = 0; 1631 throw_level = 0;
1629 #endif 1632 #endif
1630 LONGJMP (c->jmp, 1); 1633 LONGJMP (c->jmp, 1);
1631 } 1634 }
1635
1636 static DECLARE_DOESNT_RETURN (throw_or_bomb_out (Lisp_Object, Lisp_Object, int,
1637 Lisp_Object, Lisp_Object));
1632 1638
1633 static DOESNT_RETURN 1639 static DOESNT_RETURN
1634 throw_or_bomb_out (Lisp_Object tag, Lisp_Object val, int bomb_out_p, 1640 throw_or_bomb_out (Lisp_Object tag, Lisp_Object val, int bomb_out_p,
1635 Lisp_Object sig, Lisp_Object data) 1641 Lisp_Object sig, Lisp_Object data)
1636 { 1642 {
1678 if (!bomb_out_p) 1684 if (!bomb_out_p)
1679 tag = Fsignal (Qno_catch, list2 (tag, val)); 1685 tag = Fsignal (Qno_catch, list2 (tag, val));
1680 else 1686 else
1681 call1 (Qreally_early_error_handler, Fcons (sig, data)); 1687 call1 (Qreally_early_error_handler, Fcons (sig, data));
1682 } 1688 }
1683
1684 /* can't happen. who cares? - (Sun's compiler does) */
1685 /* throw_level--; */
1686 /* getting tired of compilation warnings */
1687 /* return Qnil; */
1688 } 1689 }
1689 1690
1690 /* See above, where CATCHLIST is defined, for a description of how 1691 /* See above, where CATCHLIST is defined, for a description of how
1691 Fthrow() works. 1692 Fthrow() works.
1692 1693
1704 that is EQ() to TAG. When it finds it, it will longjmp() 1705 that is EQ() to TAG. When it finds it, it will longjmp()
1705 back to the place that established the catch (in this case, 1706 back to the place that established the catch (in this case,
1706 condition_case_1). See below for more info. 1707 condition_case_1). See below for more info.
1707 */ 1708 */
1708 1709
1709 DEFUN ("throw", Fthrow, 2, 2, 0, /* 1710 DEFUN_NORETURN ("throw", Fthrow, 2, 2, 0, /*
1710 Throw to the catch for TAG and return VALUE from it. 1711 Throw to the catch for TAG and return VALUE from it.
1711 Both TAG and VALUE are evalled. 1712 Both TAG and VALUE are evalled.
1712 */ 1713 */
1713 (tag, value)) 1714 (tag, value))
1714 { 1715 {
1715 throw_or_bomb_out (tag, value, 0, Qnil, Qnil); /* Doesn't return */ 1716 throw_or_bomb_out (tag, value, 0, Qnil, Qnil); /* Doesn't return */
1716 return Qnil; 1717 RETURN_NOT_REACHED (Qnil);
1717 } 1718 }
1718 1719
1719 DEFUN ("unwind-protect", Funwind_protect, 1, UNEVALLED, 0, /* 1720 DEFUN ("unwind-protect", Funwind_protect, 1, UNEVALLED, 0, /*
1720 Do BODYFORM, protecting with UNWINDFORMS. 1721 Do BODYFORM, protecting with UNWINDFORMS.
1721 Usage looks like (unwind-protect BODYFORM UNWINDFORMS...). 1722 Usage looks like (unwind-protect BODYFORM UNWINDFORMS...).
2389 &stack_trace_displayed, 2390 &stack_trace_displayed,
2390 &debugger_entered); 2391 &debugger_entered);
2391 UNGCPRO; 2392 UNGCPRO;
2392 throw_or_bomb_out (Qtop_level, Qt, 1, error_symbol, 2393 throw_or_bomb_out (Qtop_level, Qt, 1, error_symbol,
2393 data); /* Doesn't return */ 2394 data); /* Doesn't return */
2394 return Qnil; 2395 RETURN_NOT_REACHED (Qnil);
2395 } 2396 }
2396 2397
2397 /****************** Error functions class 1 ******************/ 2398 /****************** Error functions class 1 ******************/
2398 2399
2399 /* Class 1: General functions that signal an error. 2400 /* Class 1: General functions that signal an error.
4811 const CIbyte *warning_string; 4812 const CIbyte *warning_string;
4812 Lisp_Object (*fun) (void *); 4813 Lisp_Object (*fun) (void *);
4813 void *arg; 4814 void *arg;
4814 }; 4815 };
4815 4816
4816 static Lisp_Object 4817 static DECLARE_DOESNT_RETURN_TYPE
4818 (Lisp_Object, flagged_a_squirmer (Lisp_Object, Lisp_Object, Lisp_Object));
4819
4820 static DOESNT_RETURN_TYPE (Lisp_Object)
4817 flagged_a_squirmer (Lisp_Object error_conditions, Lisp_Object data, 4821 flagged_a_squirmer (Lisp_Object error_conditions, Lisp_Object data,
4818 Lisp_Object opaque) 4822 Lisp_Object opaque)
4819 { 4823 {
4820 struct call_trapping_problems *p = 4824 struct call_trapping_problems *p =
4821 (struct call_trapping_problems *) get_opaque_ptr (opaque); 4825 (struct call_trapping_problems *) get_opaque_ptr (opaque);
4849 4853
4850 p->error_conditions = error_conditions; 4854 p->error_conditions = error_conditions;
4851 p->data = data; 4855 p->data = data;
4852 4856
4853 Fthrow (p->catchtag, Qnil); 4857 Fthrow (p->catchtag, Qnil);
4854 return Qnil; /* not reached */ 4858 RETURN_NOT_REACHED (Qnil);
4855 } 4859 }
4856 4860
4857 static Lisp_Object 4861 static Lisp_Object
4858 call_trapping_problems_2 (Lisp_Object opaque) 4862 call_trapping_problems_2 (Lisp_Object opaque)
4859 { 4863 {