mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Give GCC more control flow information, so it can be sure that
variables aren't used uninitialized. * error.h (scm_error, scm_syserror, scm_syserror_msg, scm_sysmissing, scm_num_overflow, scm_out_of_range, scm_wrong_num_args, scm_wrong_type_arg, scm_memory_error, scm_misc_error): Tell GCC that these functions never return. * struct.c (scm_struct_ref, scm_struct_set_x): If we can't figure out the field type, call abort if SCM_ASSERT returns, to placate the optimizer. * stacks.c (scm_make_stack, scm_last_stack_frame): abort if scm_wta ever returns. We can't handle this case anyway, and this gives the optimizer more information. * unif.c (scm_uniform_vector_ref, scm_array_set_x): Abort if scm_wta ever returns.
This commit is contained in:
parent
1b306e1623
commit
3323ad081e
2 changed files with 33 additions and 12 deletions
|
@ -50,21 +50,34 @@ extern int scm_ints_disabled;
|
|||
|
||||
|
||||
|
||||
/* GCC can be told that a function doesn't return; this helps it do
|
||||
better error checking (for uninitialized variable use, for
|
||||
example), and some optimization. */
|
||||
#ifdef __GNUC__
|
||||
#define SCM_NORETURN __attribute__ ((noreturn))
|
||||
#else
|
||||
#define SCM_NORETURN
|
||||
#endif
|
||||
|
||||
|
||||
extern SCM scm_errno SCM_P ((SCM arg));
|
||||
extern SCM scm_perror SCM_P ((SCM arg));
|
||||
extern void scm_error SCM_P ((SCM key, char *subr, char *message,
|
||||
SCM args, SCM rest));
|
||||
SCM args, SCM rest)) SCM_NORETURN;
|
||||
extern void (*scm_error_callback) SCM_P ((SCM key, char *subr,
|
||||
char *message, SCM args, SCM rest));
|
||||
extern void scm_syserror SCM_P ((char *subr));
|
||||
extern void scm_syserror_msg SCM_P ((char *subr, char *message, SCM args));
|
||||
extern void scm_sysmissing SCM_P ((char *subr));
|
||||
extern void scm_num_overflow SCM_P ((char *subr));
|
||||
extern void scm_out_of_range SCM_P ((char *subr, SCM bad_value));
|
||||
extern void scm_wrong_num_args SCM_P ((SCM proc));
|
||||
extern void scm_wrong_type_arg SCM_P ((char *subr, int pos, SCM bad_value));
|
||||
extern void scm_memory_error SCM_P ((char *subr));
|
||||
extern void scm_misc_error SCM_P ((char *subr, char *message, SCM args));
|
||||
extern void scm_syserror SCM_P ((char *subr)) SCM_NORETURN;
|
||||
extern void scm_syserror_msg SCM_P ((char *subr, char *message, SCM args))
|
||||
SCM_NORETURN;
|
||||
extern void scm_sysmissing SCM_P ((char *subr)) SCM_NORETURN;
|
||||
extern void scm_num_overflow SCM_P ((char *subr)) SCM_NORETURN;
|
||||
extern void scm_out_of_range SCM_P ((char *subr, SCM bad_value)) SCM_NORETURN;
|
||||
extern void scm_wrong_num_args SCM_P ((SCM proc)) SCM_NORETURN;
|
||||
extern void scm_wrong_type_arg SCM_P ((char *subr, int pos, SCM bad_value))
|
||||
SCM_NORETURN;
|
||||
extern void scm_memory_error SCM_P ((char *subr)) SCM_NORETURN;
|
||||
extern void scm_misc_error SCM_P ((char *subr, char *message, SCM args))
|
||||
SCM_NORETURN;
|
||||
extern SCM scm_wta SCM_P ((SCM arg, char *pos, char *s_subr));
|
||||
extern void scm_init_error SCM_P ((void));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue