bc: in non-interactive config, let compiler know that error funcs do not return
function old new delta bc_num_s 235 239 +4 bc_lex_next 92 91 -1 dc_parse_register 53 51 -2 dc_parse_parse 46 44 -2 bc_vm_run 624 622 -2 bc_program_assignStr 146 144 -2 bc_parse_else 135 133 -2 bc_parse_body 116 114 -2 bc_num_a 445 443 -2 bc_func_insert 97 95 -2 bc_program_pushVar 203 200 -3 bc_parse_text 133 130 -3 bc_error_bad_character 17 14 -3 bc_error 14 11 -3 bc_program_printStream 157 153 -4 bc_program_prep 91 87 -4 bc_program_copyToVar 311 307 -4 bc_num_ulong 95 90 -5 bc_num_p 445 440 -5 bc_program_print 711 704 -7 bc_parse_endBody 365 358 -7 bc_num_r 237 230 -7 bc_num_d 550 543 -7 dc_lex_token 682 674 -8 bc_program_pushArray 147 139 -8 bc_program_assign 485 475 -10 bc_program_read 333 322 -11 bc_lex_token 1278 1266 -12 bc_parse_stmt 1780 1767 -13 bc_program_modexp 723 707 -16 dc_parse_expr 762 744 -18 bc_program_execStr 496 478 -18 bc_program_call 347 329 -18 bc_vm_file 219 197 -22 bc_program_binOpPrep 311 289 -22 bc_parse_name 539 513 -26 bc_parse_parse 451 423 -28 bc_program_num 912 880 -32 bc_read_line 172 139 -33 bc_program_exec 4048 4010 -38 bc_parse_auto 313 275 -38 bc_parse_expr_empty_ok 2095 2036 -59 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/41 up/down: 4/-509) Total: -505 bytes text data bss dec hex filename 983707 485 7296 991488 f2100 busybox_old 983202 485 7296 990983 f1f07 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
3a4d5a73a8
commit
86e63cdeca
@ -976,7 +976,20 @@ static void bc_verror_msg(const char *fmt, va_list p)
|
||||
}
|
||||
}
|
||||
|
||||
static NOINLINE int bc_error_fmt(const char *fmt, ...)
|
||||
#if ENABLE_FEATURE_BC_SIGNALS
|
||||
# define ERRORFUNC /*nothing*/
|
||||
# define ERROR_RETURN(a) a
|
||||
#else
|
||||
# if ENABLE_FEATURE_CLEAN_UP
|
||||
# define ERRORFUNC /*nothing*/
|
||||
# define ERROR_RETURN(a) a
|
||||
# else
|
||||
# define ERRORFUNC NORETURN
|
||||
# define ERROR_RETURN(a) /*nothing*/
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static NOINLINE ERRORFUNC int bc_error_fmt(const char *fmt, ...)
|
||||
{
|
||||
va_list p;
|
||||
|
||||
@ -986,7 +999,7 @@ static NOINLINE int bc_error_fmt(const char *fmt, ...)
|
||||
|
||||
if (!ENABLE_FEATURE_CLEAN_UP && !G_ttyin)
|
||||
exit(1);
|
||||
return BC_STATUS_FAILURE;
|
||||
ERROR_RETURN(return BC_STATUS_FAILURE;)
|
||||
}
|
||||
|
||||
#if ENABLE_BC
|
||||
@ -1016,9 +1029,33 @@ static NOINLINE int bc_posix_error_fmt(const char *fmt, ...)
|
||||
// function must not have caller-cleaned parameters on stack.
|
||||
// Unfortunately, vararg function API does exactly that on most arches.
|
||||
// Thus, use these shims for the cases when we have no vararg PARAMS:
|
||||
static int bc_error(const char *msg)
|
||||
static ERRORFUNC int bc_error(const char *msg)
|
||||
{
|
||||
return bc_error_fmt("%s", msg);
|
||||
ERROR_RETURN(return) bc_error_fmt("%s", msg);
|
||||
}
|
||||
static ERRORFUNC int bc_error_bad_character(char c)
|
||||
{
|
||||
ERROR_RETURN(return) bc_error_fmt("bad character '%c'", c);
|
||||
}
|
||||
static ERRORFUNC int bc_error_bad_expression(void)
|
||||
{
|
||||
ERROR_RETURN(return) bc_error("bad expression");
|
||||
}
|
||||
static ERRORFUNC int bc_error_bad_token(void)
|
||||
{
|
||||
ERROR_RETURN(return) bc_error("bad token");
|
||||
}
|
||||
static ERRORFUNC int bc_error_stack_has_too_few_elements(void)
|
||||
{
|
||||
ERROR_RETURN(return) bc_error("stack has too few elements");
|
||||
}
|
||||
static ERRORFUNC int bc_error_variable_is_wrong_type(void)
|
||||
{
|
||||
ERROR_RETURN(return) bc_error("variable is wrong type");
|
||||
}
|
||||
static ERRORFUNC int bc_error_nested_read_call(void)
|
||||
{
|
||||
ERROR_RETURN(return) bc_error("read() call inside of a read() call");
|
||||
}
|
||||
#if ENABLE_BC
|
||||
static int bc_POSIX_requires(const char *msg)
|
||||
@ -1038,30 +1075,6 @@ static int bc_POSIX_does_not_allow_empty_X_expression_in_for(const char *msg)
|
||||
return bc_posix_error_fmt("%san empty %s expression in a for loop", "POSIX does not allow ", msg);
|
||||
}
|
||||
#endif
|
||||
static int bc_error_bad_character(char c)
|
||||
{
|
||||
return bc_error_fmt("bad character '%c'", c);
|
||||
}
|
||||
static int bc_error_bad_expression(void)
|
||||
{
|
||||
return bc_error("bad expression");
|
||||
}
|
||||
static int bc_error_bad_token(void)
|
||||
{
|
||||
return bc_error("bad token");
|
||||
}
|
||||
static int bc_error_stack_has_too_few_elements(void)
|
||||
{
|
||||
return bc_error("stack has too few elements");
|
||||
}
|
||||
static int bc_error_variable_is_wrong_type(void)
|
||||
{
|
||||
return bc_error("variable is wrong type");
|
||||
}
|
||||
static int bc_error_nested_read_call(void)
|
||||
{
|
||||
return bc_error("read() call inside of a read() call");
|
||||
}
|
||||
|
||||
static void bc_vec_grow(BcVec *v, size_t n)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user