Branch: Tag:

2015-04-19

2015-04-19 06:15:15 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Coverity: Added quite a few function annotations.

Hopefully Coverity will stop complaining about code after
errors being thrown.

Potential fix for [CID 1294628] and others.

242:   PMOD_EXPORT int throw_severity;   static const char *in_error;    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void low_error(const char *buf) ATTRIBUTE((noreturn))   {    push_error(buf);
262:    f_aggregate(2);   }    + /* coverity[+kill] */   PMOD_EXPORT void DECLSPEC(noreturn) va_error(const char *fmt, va_list args)    ATTRIBUTE((noreturn))   {
317:    va_end(args);   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void new_error(const char *name,    const char *text,    struct svalue *oldsp,
399:      static int inhibit_errors = 0;    + /* coverity[+kill] */   PMOD_EXPORT void exit_on_error(const void *msg)   {    ONERROR tmp;
472:    do_abort();   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void debug_va_fatal(const char *fmt, va_list args) ATTRIBUTE((noreturn))   {    static int in_fatal = 0;
898:    * fmt_args using string_builder_vsprintf. (fmt_args is passed as a    * va_list pointer to be able to pass NULL if fmt is NULL.)    */ + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void generic_error_va(    struct object *o, const char *func, const struct svalue *base_sp, int args,    const char *fmt, va_list *fmt_args)
973:    * At least fast_clone_object() MUST have been used, or the object    * data must have been properly initialized in some other way!    */ + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void throw_error_object(    struct object *o,    const char *func,
986:    ERROR_DONE(generic);   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void generic_error(    const char *func,    struct svalue *base_sp, int args,
995:    ERROR_DONE(generic);   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void index_error(    const char *func,    struct svalue *base_sp, int args,
1008:    ERROR_DONE(generic);   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error(    const char *func,    struct svalue *base_sp, int args,
1029:    ERROR_DONE(generic);   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void math_error(    const char *func,    struct svalue *base_sp, int args,
1046:    ERROR_DONE(generic);   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void resource_error(    const char *func,    struct svalue *base_sp, int args,
1060:    ERROR_DONE(generic);   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void permission_error(    const char *func,    struct svalue *base_sp, int args,
1072:    ERROR_DONE(generic);   }    + /* coverity[+kill] */   PMOD_EXPORT void wrong_number_of_args_error(const char *name, int args, int expected)   {    if(expected>args)