зеркало из https://github.com/github/ruby.git
[ruby/openssl] Suppress printf format warnings
* Add `printf` format attribute to `ossl_raise`. * Fix a format specifier in `config_load_bio`. * Use `ASSUME` for the unreachable condition. https://github.com/ruby/openssl/commit/41da2955db
This commit is contained in:
Родитель
11fd3fec53
Коммит
c7dce12eb9
|
@ -265,6 +265,8 @@ ossl_to_der_if_possible(VALUE obj)
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRINTF_ARGS(static VALUE ossl_make_error(VALUE exc, const char *fmt, va_list args), 2, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Errors
|
* Errors
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -120,7 +120,7 @@ int ossl_pem_passwd_cb(char *, int, int, void *);
|
||||||
/*
|
/*
|
||||||
* ERRor messages
|
* ERRor messages
|
||||||
*/
|
*/
|
||||||
NORETURN(void ossl_raise(VALUE, const char *, ...));
|
PRINTF_ARGS(NORETURN(void ossl_raise(VALUE, const char *, ...)), 2, 3);
|
||||||
/* Clear OpenSSL error queue. If dOSSL is set, rb_warn() them. */
|
/* Clear OpenSSL error queue. If dOSSL is set, rb_warn() them. */
|
||||||
void ossl_clear_error(void);
|
void ossl_clear_error(void);
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ config_load_bio(CONF *conf, BIO *bio)
|
||||||
if (eline <= 0)
|
if (eline <= 0)
|
||||||
ossl_raise(eConfigError, "wrong config format");
|
ossl_raise(eConfigError, "wrong config format");
|
||||||
else
|
else
|
||||||
ossl_raise(eConfigError, "error in line %d", eline);
|
ossl_raise(eConfigError, "error in line %ld", eline);
|
||||||
}
|
}
|
||||||
BIO_free(bio);
|
BIO_free(bio);
|
||||||
|
|
||||||
|
|
|
@ -596,8 +596,10 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
|
||||||
ossl_raise(rb_eArgError, "wrong number of arguments");
|
ossl_raise(rb_eArgError, "wrong number of arguments");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (group == NULL)
|
#if !defined(LIKELY) && !defined(RB_LIKELY)
|
||||||
ossl_raise(eEC_GROUP, "");
|
#define LIKELY(x) (x)
|
||||||
|
#endif
|
||||||
|
ASSUME(group);
|
||||||
RTYPEDDATA_DATA(self) = group;
|
RTYPEDDATA_DATA(self) = group;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче