1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/openssl: suppress warnings.

* ext/openssl/ossl.h (OSSL_Debug): don't use gcc extention for
  variadic macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-03-12 13:44:37 +00:00
parent 61c216748c
commit 2412162959
8 changed files with 61 additions and 54 deletions

View file

@ -1,3 +1,10 @@
Thu Mar 12 22:41:41 2009 Tanaka Akira <akr@fsij.org>
* ext/openssl: suppress warnings.
* ext/openssl/ossl.h (OSSL_Debug): don't use gcc extention for
variadic macro.
Thu Mar 12 22:29:36 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/Makefile.sub (WARNFLAGS): warning 4996 is only in VC++8 or

View file

@ -99,7 +99,7 @@ have_func("OPENSSL_cleanse")
unless have_func("SSL_set_tlsext_host_name", ['openssl/ssl.h'])
have_macro("SSL_set_tlsext_host_name", ['openssl/ssl.h']) && $defs.push("-DHAVE_SSL_SET_TLSEXT_HOST_NAME")
end
if try_compile("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n int x(){FOO(1);FOO(1,2);FOO(1,2,3);}\n")
if try_compile("#define FOO(...) foo(__VA_ARGS__)\n int x(){FOO(1);FOO(1,2);FOO(1,2,3);}\n")
$defs.push("-DHAVE_VA_ARGS_MACRO")
end
if have_header("openssl/engine.h")

View file

@ -163,10 +163,10 @@ VALUE ossl_to_der_if_possible(VALUE);
extern VALUE dOSSL;
#if defined(HAVE_VA_ARGS_MACRO)
#define OSSL_Debug(fmt, ...) do { \
#define OSSL_Debug(...) do { \
if (dOSSL == Qtrue) { \
fprintf(stderr, "OSSL_DEBUG: "); \
fprintf(stderr, fmt, ##__VA_ARGS__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, " [%s:%d]\n", __FILE__, __LINE__); \
} \
} while (0)

View file

@ -272,9 +272,9 @@ ossl_bn_coerce(VALUE self, VALUE other)
} \
return Qfalse; \
}
BIGNUM_BOOL1(is_zero);
BIGNUM_BOOL1(is_one);
BIGNUM_BOOL1(is_odd);
BIGNUM_BOOL1(is_zero)
BIGNUM_BOOL1(is_one)
BIGNUM_BOOL1(is_odd)
#define BIGNUM_1c(func) \
/* \
@ -298,7 +298,7 @@ BIGNUM_BOOL1(is_odd);
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
BIGNUM_1c(sqr);
BIGNUM_1c(sqr)
#define BIGNUM_2(func) \
/* \
@ -322,8 +322,8 @@ BIGNUM_1c(sqr);
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
BIGNUM_2(add);
BIGNUM_2(sub);
BIGNUM_2(add)
BIGNUM_2(sub)
#define BIGNUM_2c(func) \
/* \
@ -347,12 +347,12 @@ BIGNUM_2(sub);
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
BIGNUM_2c(mul);
BIGNUM_2c(mod);
BIGNUM_2c(exp);
BIGNUM_2c(gcd);
BIGNUM_2c(mod_sqr);
BIGNUM_2c(mod_inverse);
BIGNUM_2c(mul)
BIGNUM_2c(mod)
BIGNUM_2c(exp)
BIGNUM_2c(gcd)
BIGNUM_2c(mod_sqr)
BIGNUM_2c(mod_inverse)
/*
* call-seq:
@ -407,10 +407,10 @@ ossl_bn_div(VALUE self, VALUE other)
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
BIGNUM_3c(mod_add);
BIGNUM_3c(mod_sub);
BIGNUM_3c(mod_mul);
BIGNUM_3c(mod_exp);
BIGNUM_3c(mod_add)
BIGNUM_3c(mod_sub)
BIGNUM_3c(mod_mul)
BIGNUM_3c(mod_exp)
#define BIGNUM_BIT(func) \
/* \
@ -428,9 +428,9 @@ BIGNUM_3c(mod_exp);
} \
return self; \
}
BIGNUM_BIT(set_bit);
BIGNUM_BIT(clear_bit);
BIGNUM_BIT(mask_bits);
BIGNUM_BIT(set_bit)
BIGNUM_BIT(clear_bit)
BIGNUM_BIT(mask_bits)
/*
* call-seq:
@ -474,8 +474,8 @@ ossl_bn_is_bit_set(VALUE self, VALUE bit)
WrapBN(CLASS_OF(self), obj, result); \
return obj; \
}
BIGNUM_SHIFT(lshift);
BIGNUM_SHIFT(rshift);
BIGNUM_SHIFT(lshift)
BIGNUM_SHIFT(rshift)
#define BIGNUM_SELF_SHIFT(func) \
/* \
@ -494,8 +494,8 @@ BIGNUM_SHIFT(rshift);
ossl_raise(eBNError, NULL); \
return self; \
}
BIGNUM_SELF_SHIFT(lshift);
BIGNUM_SELF_SHIFT(rshift);
BIGNUM_SELF_SHIFT(lshift)
BIGNUM_SELF_SHIFT(rshift)
#define BIGNUM_RAND(func) \
/* \
@ -528,8 +528,8 @@ BIGNUM_SELF_SHIFT(rshift);
WrapBN(klass, obj, result); \
return obj; \
}
BIGNUM_RAND(rand);
BIGNUM_RAND(pseudo_rand);
BIGNUM_RAND(rand)
BIGNUM_RAND(pseudo_rand)
#define BIGNUM_RAND_RANGE(func) \
/* \
@ -552,8 +552,8 @@ BIGNUM_RAND(pseudo_rand);
WrapBN(klass, obj, result); \
return obj; \
}
BIGNUM_RAND_RANGE(rand);
BIGNUM_RAND_RANGE(pseudo_rand);
BIGNUM_RAND_RANGE(rand)
BIGNUM_RAND_RANGE(pseudo_rand)
/*
* call-seq:
@ -608,8 +608,8 @@ ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)
GetBN(self, bn); \
return INT2FIX(BN_##func(bn)); \
}
BIGNUM_NUM(num_bytes);
BIGNUM_NUM(num_bits);
BIGNUM_NUM(num_bytes)
BIGNUM_NUM(num_bits)
static VALUE
ossl_bn_copy(VALUE self, VALUE other)
@ -642,8 +642,8 @@ ossl_bn_copy(VALUE self, VALUE other)
GetBN(self, bn1); \
return INT2FIX(BN_##func(bn1, bn2)); \
}
BIGNUM_CMP(cmp);
BIGNUM_CMP(ucmp);
BIGNUM_CMP(cmp)
BIGNUM_CMP(ucmp)
static VALUE
ossl_bn_eql(VALUE self, VALUE other)

View file

@ -300,7 +300,7 @@ get_conf_section(CONF_VALUE *cv, VALUE ary)
rb_ary_push(ary, rb_str_new2(cv->section));
}
static IMPLEMENT_LHASH_DOALL_ARG_FN(get_conf_section, CONF_VALUE*, VALUE);
static IMPLEMENT_LHASH_DOALL_ARG_FN(get_conf_section, CONF_VALUE*, VALUE)
static VALUE
ossl_config_get_sections(VALUE self)
@ -338,7 +338,7 @@ dump_conf_value(CONF_VALUE *cv, VALUE str)
rb_str_cat2(str, "\n");
}
static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_conf_value, CONF_VALUE*, VALUE);
static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_conf_value, CONF_VALUE*, VALUE)
static VALUE
dump_conf(CONF *conf)
@ -382,7 +382,7 @@ each_conf_value(CONF_VALUE *cv, void* dummy)
}
}
static IMPLEMENT_LHASH_DOALL_ARG_FN(each_conf_value, CONF_VALUE*, void*);
static IMPLEMENT_LHASH_DOALL_ARG_FN(each_conf_value, CONF_VALUE*, void*)
static VALUE
ossl_config_each(VALUE self)

View file

@ -415,10 +415,10 @@ ossl_dh_compute_key(VALUE self, VALUE pub)
return str;
}
OSSL_PKEY_BN(dh, p);
OSSL_PKEY_BN(dh, g);
OSSL_PKEY_BN(dh, pub_key);
OSSL_PKEY_BN(dh, priv_key);
OSSL_PKEY_BN(dh, p)
OSSL_PKEY_BN(dh, g)
OSSL_PKEY_BN(dh, pub_key)
OSSL_PKEY_BN(dh, priv_key)
/*
* -----BEGIN DH PARAMETERS-----

View file

@ -433,11 +433,11 @@ ossl_dsa_verify(VALUE self, VALUE digest, VALUE sig)
return Qfalse;
}
OSSL_PKEY_BN(dsa, p);
OSSL_PKEY_BN(dsa, q);
OSSL_PKEY_BN(dsa, g);
OSSL_PKEY_BN(dsa, pub_key);
OSSL_PKEY_BN(dsa, priv_key);
OSSL_PKEY_BN(dsa, p)
OSSL_PKEY_BN(dsa, q)
OSSL_PKEY_BN(dsa, g)
OSSL_PKEY_BN(dsa, pub_key)
OSSL_PKEY_BN(dsa, priv_key)
/*
* INIT

View file

@ -519,14 +519,14 @@ ossl_rsa_blinding_off(VALUE self)
}
*/
OSSL_PKEY_BN(rsa, n);
OSSL_PKEY_BN(rsa, e);
OSSL_PKEY_BN(rsa, d);
OSSL_PKEY_BN(rsa, p);
OSSL_PKEY_BN(rsa, q);
OSSL_PKEY_BN(rsa, dmp1);
OSSL_PKEY_BN(rsa, dmq1);
OSSL_PKEY_BN(rsa, iqmp);
OSSL_PKEY_BN(rsa, n)
OSSL_PKEY_BN(rsa, e)
OSSL_PKEY_BN(rsa, d)
OSSL_PKEY_BN(rsa, p)
OSSL_PKEY_BN(rsa, q)
OSSL_PKEY_BN(rsa, dmp1)
OSSL_PKEY_BN(rsa, dmq1)
OSSL_PKEY_BN(rsa, iqmp)
/*
* INIT