Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-454 Makefile.PL, XS and installation fixes #455

Merged
merged 7 commits into from
Jan 1, 2024
Prev Previous commit
Next Next commit
GH-454 More fixes to address 'no code before declaration' warnings.
Fix additional cases with code before variable declarations. These were added
before the longer commit by bulk88 which fixed a lot of previously existing
cases.

Note that Perl 5.35.5 and later relax this requirement because 5.35.5 and later
versions use some of C99 (C standard ISO/IEC 9899:1999) features.

Gcc and Clang flag -Werror=declaration-after-statement is especially mentioned
as something that should only be used with Perl versions earlier than 5.35.5.

https://perldoc.perl.org/5.35.5/perldelta#Configuration-and-Compilation

SSLeay.xs currently avoids code before declarations.
h-vn committed Dec 29, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 001aa0a8871b5d9c0e05eeed9494861407fc27d3
7 changes: 7 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -134,6 +134,13 @@ Revision history for Perl extension Net::SSLeay.
related functions.
- Support finding OpenSSL libraries using
ExtUtils::PkgConfig. Thanks to Paul Howarth for the patch.
- Fix a number of cases where variables were declared after
code triggering Gcc and Clang warning
-Wdeclaration-after-statement. This is supported by C
language version C99 and used by Perl 5.35.5 and
later. SSLeay.xs is likely compiled with compilers that do
not support this, therefore such constructs are avoided in
SSLeay.xs. Thanks to GitHub user bulk88 for the patch.

1.93_02 2023-02-22
- Update ppport.h to version 3.68. This eliminates thousands of
23 changes: 15 additions & 8 deletions SSLeay.xs
Original file line number Diff line number Diff line change
@@ -2997,8 +2997,9 @@ SSL_has_pending(s)
#ifdef NET_SSLEAY_32BIT_INT_PERL
int
OPENSSL_init_ssl(double opts, SV *sv_settings = &PL_sv_undef)
CODE:
PREINIT:
const OPENSSL_INIT_SETTINGS *settings = NULL;
CODE:
if (sv_settings != &PL_sv_undef)
settings = INT2PTR(OPENSSL_INIT_SETTINGS *, SvIV(sv_settings));
RETVAL = OPENSSL_init_ssl(opts, settings);
@@ -3007,8 +3008,9 @@ OPENSSL_init_ssl(double opts, SV *sv_settings = &PL_sv_undef)

int
OPENSSL_init_crypto(double opts, SV *sv_settings = &PL_sv_undef)
CODE:
PREINIT:
const OPENSSL_INIT_SETTINGS *settings = NULL;
CODE:
if (sv_settings != &PL_sv_undef)
settings = INT2PTR(OPENSSL_INIT_SETTINGS *, SvIV(sv_settings));
RETVAL = OPENSSL_init_crypto(opts, settings);
@@ -3018,8 +3020,9 @@ OPENSSL_init_crypto(double opts, SV *sv_settings = &PL_sv_undef)
#else
int
OPENSSL_init_ssl(uint64_t opts, SV *sv_settings = &PL_sv_undef)
CODE:
PREINIT:
const OPENSSL_INIT_SETTINGS *settings = NULL;
CODE:
if (sv_settings != &PL_sv_undef)
settings = INT2PTR(OPENSSL_INIT_SETTINGS *, SvIV(sv_settings));
RETVAL = OPENSSL_init_ssl(opts, settings);
@@ -3028,8 +3031,9 @@ OPENSSL_init_ssl(uint64_t opts, SV *sv_settings = &PL_sv_undef)

int
OPENSSL_init_crypto(uint64_t opts, SV *sv_settings = &PL_sv_undef)
CODE:
PREINIT:
const OPENSSL_INIT_SETTINGS *settings = NULL;
CODE:
if (sv_settings != &PL_sv_undef)
settings = INT2PTR(OPENSSL_INIT_SETTINGS *, SvIV(sv_settings));
RETVAL = OPENSSL_init_crypto(opts, settings);
@@ -8656,8 +8660,9 @@ OSSL_LIB_CTX_get0_global_default()

OSSL_PROVIDER *
OSSL_PROVIDER_load(SV *libctx, const char *name)
CODE:
PREINIT:
OSSL_LIB_CTX *ctx = NULL;
CODE:
if (libctx != &PL_sv_undef)
ctx = INT2PTR(OSSL_LIB_CTX *, SvIV(libctx));
RETVAL = OSSL_PROVIDER_load(ctx, name);
@@ -8668,8 +8673,9 @@ OSSL_PROVIDER_load(SV *libctx, const char *name)

OSSL_PROVIDER *
OSSL_PROVIDER_try_load(SV *libctx, const char *name, int retain_fallbacks)
CODE:
PREINIT:
OSSL_LIB_CTX *ctx = NULL;
CODE:
if (libctx != &PL_sv_undef)
ctx = INT2PTR(OSSL_LIB_CTX *, SvIV(libctx));
RETVAL = OSSL_PROVIDER_try_load(ctx, name, retain_fallbacks);
@@ -8683,8 +8689,9 @@ OSSL_PROVIDER_unload(OSSL_PROVIDER *prov)

int
OSSL_PROVIDER_available(SV *libctx, const char *name)
CODE:
PREINIT:
OSSL_LIB_CTX *ctx = NULL;
CODE:
if (libctx != &PL_sv_undef)
ctx = INT2PTR(OSSL_LIB_CTX *, SvIV(libctx));
RETVAL = OSSL_PROVIDER_available(ctx, name);
@@ -8695,8 +8702,8 @@ int
OSSL_PROVIDER_do_all(SV *libctx, SV *perl_cb, SV *perl_cbdata = &PL_sv_undef)
PREINIT:
simple_cb_data_t* cbdata = NULL;
CODE:
OSSL_LIB_CTX *ctx = NULL;
CODE:
if (libctx != &PL_sv_undef)
ctx = INT2PTR(OSSL_LIB_CTX *, SvIV(libctx));