diff options
| author | Paul Eggert | 2011-03-15 14:56:37 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-03-15 14:56:37 -0700 |
| commit | e5aab7e74931e4b4b0fd21abf4a6ea5b7f5134f4 (patch) | |
| tree | 1021a2e6d6d8dff1f7bde16072e4bf30ce349e66 /src | |
| parent | 76ef09b7c8407733a7e55dd1b14e7807ba83ae5b (diff) | |
| download | emacs-e5aab7e74931e4b4b0fd21abf4a6ea5b7f5134f4.tar.gz emacs-e5aab7e74931e4b4b0fd21abf4a6ea5b7f5134f4.zip | |
* alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
* lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
avoids undefined behavior in theory.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/alloc.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index aa03ad660b7..d34e3478255 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2011-03-15 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-03-15 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST. | ||
| 4 | * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this | ||
| 5 | avoids undefined behavior in theory. | ||
| 6 | |||
| 3 | * regex.c (IF_LINT): Add defn, for benefit of ../lib-src. | 7 | * regex.c (IF_LINT): Add defn, for benefit of ../lib-src. |
| 4 | 8 | ||
| 5 | Use functions, not macros, for up- and down-casing (Bug#8254). | 9 | Use functions, not macros, for up- and down-casing (Bug#8254). |
diff --git a/src/alloc.c b/src/alloc.c index d6b64de5af9..1ad8af0d61a 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2653,17 +2653,17 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, | |||
| 2653 | return val; | 2653 | return val; |
| 2654 | } | 2654 | } |
| 2655 | 2655 | ||
| 2656 | #ifdef GC_CHECK_CONS_LIST | ||
| 2656 | /* Get an error now if there's any junk in the cons free list. */ | 2657 | /* Get an error now if there's any junk in the cons free list. */ |
| 2657 | void | 2658 | void |
| 2658 | check_cons_list (void) | 2659 | check_cons_list (void) |
| 2659 | { | 2660 | { |
| 2660 | #ifdef GC_CHECK_CONS_LIST | ||
| 2661 | struct Lisp_Cons *tail = cons_free_list; | 2661 | struct Lisp_Cons *tail = cons_free_list; |
| 2662 | 2662 | ||
| 2663 | while (tail) | 2663 | while (tail) |
| 2664 | tail = tail->u.chain; | 2664 | tail = tail->u.chain; |
| 2665 | #endif | ||
| 2666 | } | 2665 | } |
| 2666 | #endif | ||
| 2667 | 2667 | ||
| 2668 | /* Make a list of 1, 2, 3, 4 or 5 specified objects. */ | 2668 | /* Make a list of 1, 2, 3, 4 or 5 specified objects. */ |
| 2669 | 2669 | ||
diff --git a/src/lisp.h b/src/lisp.h index ec45b83863b..79f3b2f980b 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -27,9 +27,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 27 | types of run time checks for Lisp objects. */ | 27 | types of run time checks for Lisp objects. */ |
| 28 | 28 | ||
| 29 | #ifdef GC_CHECK_CONS_LIST | 29 | #ifdef GC_CHECK_CONS_LIST |
| 30 | #define CHECK_CONS_LIST() check_cons_list() | 30 | extern void check_cons_list (void); |
| 31 | #define CHECK_CONS_LIST() check_cons_list () | ||
| 31 | #else | 32 | #else |
| 32 | #define CHECK_CONS_LIST() ((void)0) | 33 | #define CHECK_CONS_LIST() ((void) 0) |
| 33 | #endif | 34 | #endif |
| 34 | 35 | ||
| 35 | /* These are default choices for the types to use. */ | 36 | /* These are default choices for the types to use. */ |