* src/search.c (fast_string_match): Use a temporary to avoid
warning about constness.
* src/openssl.c (Fossl_digest_file): Mark set unused but unused
variable.
(Fossl_pem_write_public_key): Ditto.
(Fossl_pem_write_key): Ditto.
(Fossl_ssl_read): Ditto.
(Fossl_ssl_write): Ditto.
(ossl_ssl_prepare_cmeth): Ignore drop of const qualifier. The
alternative of using const for SSL methods everywhere is not
workable if we are to support older OpenSSL versions.
(ossl_ssl_prepare_smeth): Ditto.
* src/alloc.c (make_string_nocopy): Remove unnecessary cast.
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
#ifdef EF_USE_COMPRE
s->compre = Qnil;
#endif
#ifdef EF_USE_COMPRE
s->compre = Qnil;
#endif
- set_string_data(s, (Bufbyte*)contents);
+ set_string_data(s, contents);
set_string_length(s, length);
XSETSTRING(val, s);
set_string_length(s, length);
XSETSTRING(val, s);
mdctx = xnew(EVP_MD_CTX);
EVP_MD_CTX_init(mdctx);
md_blocksize = (unsigned int)(EVP_MD_block_size(md) / 8);
mdctx = xnew(EVP_MD_CTX);
EVP_MD_CTX_init(mdctx);
md_blocksize = (unsigned int)(EVP_MD_block_size(md) / 8);
+ SXE_SET_UNUSED(md_blocksize);
EVP_DigestInit_ex(mdctx, md, NULL);
EVP_DigestInit_ex(mdctx, md, NULL);
pk = XEVPPKEY(pkey)->evp_pkey;
pk509 = XEVPPKEY(pkey)->x509;
pk = XEVPPKEY(pkey)->evp_pkey;
pk509 = XEVPPKEY(pkey)->x509;
if ((fp = fopen((char *)XSTRING_DATA(file), "w")) == NULL)
error ("error opening file.");
if ((fp = fopen((char *)XSTRING_DATA(file), "w")) == NULL)
error ("error opening file.");
pk = XEVPPKEY(pkey)->evp_pkey;
pk509 = XEVPPKEY(pkey)->x509;
pk = XEVPPKEY(pkey)->evp_pkey;
pk509 = XEVPPKEY(pkey)->x509;
if (!ossl_pkey_has_private_data(pk))
return Fossl_pem_write_public_key(file, pkey);
if (!ossl_pkey_has_private_data(pk))
return Fossl_pem_write_public_key(file, pkey);
static Lisp_Object
ossl_ssl_prepare_cmeth(Lisp_Object method)
{
static Lisp_Object
ossl_ssl_prepare_cmeth(Lisp_Object method)
{
- SSL_METHOD *meth = NULL;
+ SSL_METHOD *meth = NULL;
Lisp_SSL_CONN *lisp_ssl_conn;
/* start preparing the conn object */
SSL_library_init();
SSL_load_error_strings();
Lisp_SSL_CONN *lisp_ssl_conn;
/* start preparing the conn object */
SSL_library_init();
SSL_load_error_strings();
+ /* I would love to make 'meth' const SSL_METHOD* as well as the
+ 'ssl_meth' member of 'Lisp_SSL_CONN' unfortunately not all
+ supported versions of OpenSSL then take const SSL_METHOD*
+ as arguments, so turning off the cast qualifier warning and
+ store non-const is a more reasonable solution.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-qual"
if (0) {
} else if (EQ(method, Qssl2)) {
#if HAVE_SSLV2_CLIENT_METHOD
if (0) {
} else if (EQ(method, Qssl2)) {
#if HAVE_SSLV2_CLIENT_METHOD
error("default tlsv1 client method not supported");
#endif
}
error("default tlsv1 client method not supported");
#endif
}
+#pragma GCC diagnostic pop
if (!RAND_status())
error("OSSL: not enough random data");
if (!RAND_status())
error("OSSL: not enough random data");
SSL_library_init();
SSL_load_error_strings();
SSL_library_init();
SSL_load_error_strings();
+ /* I would love to make 'meth' const SSL_METHOD* as well as the
+ 'ssl_meth' member of 'Lisp_SSL_CONN' unfortunately not all
+ supported versions of OpenSSL then take const SSL_METHOD*
+ as arguments, so turning off the cast qualifier warning and
+ store non-const is a more reasonable solution.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-qual"
if (0) {
} else if (EQ(method, Qssl2)) {
#if HAVE_SSLV2_SERVER_METHOD
if (0) {
} else if (EQ(method, Qssl2)) {
#if HAVE_SSLV2_SERVER_METHOD
error("default sslv23 client method not supported");
#endif
}
error("default sslv23 client method not supported");
#endif
}
+#pragma GCC diagnostic pop
if (!RAND_status())
error("OSSL: not enough random data");
if (!RAND_status())
error("OSSL: not enough random data");
error("SSL connection dead");
conn = XSSLCONN(ssl_conn)->ssl_conn;
error("SSL connection dead");
conn = XSSLCONN(ssl_conn)->ssl_conn;
+ SXE_SET_UNUSED(conn);
+
process = XSSLCONN(ssl_conn)->parent;
/* Make sure the process is really alive. */
process = XSSLCONN(ssl_conn)->parent;
/* Make sure the process is really alive. */
/* store the original process filter */
proc_filter = XPROCESS(process)->filter;
/* store the original process filter */
proc_filter = XPROCESS(process)->filter;
+ SXE_SET_UNUSED(proc_filter);
ret = Lstream_write(out, XSTRING_DATA(string), XSTRING_LENGTH(string));
Lstream_flush(out);
ret = Lstream_write(out, XSTRING_DATA(string), XSTRING_LENGTH(string));
Lstream_flush(out);
return with failure...
*/
return -1;
return with failure...
*/
return -1;
- newnonreloc = alloca(length);
- memcpy((void*)newnonreloc, (void*)XSTRING_DATA(reloc), length);
+ Bufbyte *copy = alloca(length);
+ memcpy((void*)copy,
+ (const void*)XSTRING_DATA(reloc),
+ length);
+ newnonreloc = copy;
if (!SUBRP (subr))
wrong_type_argument (Qsubrp, subr);
name = XSUBR (subr)->name;
if (!SUBRP (subr))
wrong_type_argument (Qsubrp, subr);
name = XSUBR (subr)->name;
- return make_string ((Bufbyte *)name, strlen (name));
+ return make_string ((const Bufbyte *)name, strlen (name));