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

_ssl compiler warnings #47222

Closed
benjaminp opened this issue May 26, 2008 · 15 comments
Closed

_ssl compiler warnings #47222

benjaminp opened this issue May 26, 2008 · 15 comments
Labels
build The build process and cross-build extension-modules C modules in the Modules dir

Comments

@benjaminp
Copy link
Contributor

BPO 2973
Nosy @warsaw, @abalkin, @pitrou, @vstinner, @tiran, @devdanzin, @benjaminp, @florentx
Files
  • issue2973-D2I_PARAMETER_2_TYPE.patch: issue2973-D2I_PARAMETER_2_TYPE.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2011-01-06.15:46:39.161>
    created_at = <Date 2008-05-26.17:15:22.007>
    labels = ['extension-modules', 'build']
    title = '_ssl compiler warnings'
    updated_at = <Date 2011-01-07.13:31:17.989>
    user = 'https://github.com/benjaminp'

    bugs.python.org fields:

    activity = <Date 2011-01-07.13:31:17.989>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-01-06.15:46:39.161>
    closer = 'pitrou'
    components = ['Extension Modules']
    creation = <Date 2008-05-26.17:15:22.007>
    creator = 'benjamin.peterson'
    dependencies = []
    files = ['14811']
    hgrepos = []
    issue_num = 2973
    keywords = ['patch']
    message_count = 15.0
    messages = ['67376', '67468', '68915', '68917', '87916', '92105', '97506', '97507', '100315', '100340', '100344', '100402', '125559', '125603', '125643']
    nosy_count = 10.0
    nosy_names = ['barry', 'janssen', 'belopolsky', 'pitrou', 'vstinner', 'christian.heimes', 'ajaksu2', 'benjamin.peterson', 'grooverdan', 'flox']
    pr_nums = []
    priority = 'low'
    resolution = 'out of date'
    stage = None
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue2973'
    versions = ['Python 2.6', 'Python 3.1', 'Python 2.7', 'Python 3.2']

    @benjaminp
    Copy link
    Contributor Author

    When compiling the _ssl extension on MacOS 10.4, I get these warnings:
    /users/benjamin/python/trunk/Modules/_ssl.c: In function
    '_get_peer_alt_names':
    /users/benjamin/python/trunk/Modules/_ssl.c:694 warning: passing
    argument 2 of 'ASN1_item_d2i' from incompatible pointer type
    /users/benjamin/python/trunk/Modules/_ssl.c:698: warning: passing
    argument 2 of 'method->d2i' from incompatible pointer type

    @benjaminp benjaminp added extension-modules C modules in the Modules dir build The build process and cross-build labels May 26, 2008
    @abalkin
    Copy link
    Member

    abalkin commented May 29, 2008

    It looks like this comes from r59493 which purports to fix a warning:

    ------------------------------------------------------------------------
    r59493 | christian.heimes | 2007-12-13 23:38:13 -0500 (Thu, 13 Dec 2007)
    | 1 line

    Fixed warning in ssl module
    ------------------------------------------------------------------------

    --- Modules/_ssl.c      (revision 59492)
    +++ Modules/_ssl.c      (revision 59493)
    @@ -660,7 +660,7 @@
            char buf[2048];
            char *vptr;
            int len;
    -       unsigned char *p;
    +       const unsigned char *p;
     
            if (certificate == NULL)
                    return peer_alt_names;

    On MacOS 10.4 with OpenSSL 0.9.7i, ASN1_item_d2i is declared without
    const, so reverting fixes the warning.

    I guess Christian was developing on a system with a different OpenSSL
    version, so we need to hear from him before attempting another fix.

    @janssen
    Copy link
    Mannequin

    janssen mannequin commented Jun 28, 2008

    Any progress here? I haven't yet found a formulation which suppresses
    the warning on all platforms. I'm guessing there will have to be some
    kind of cpp test

    #if SOMEFEATURE
    #define D2I_PARAMETER_2_TYPE unsigned char *
    #else
    #define D2I_PARAMETER_2_TYPE const unsigned char *
    #endif

    @benjaminp
    Copy link
    Contributor Author

    Yes, although I have no idea what that feature may be... (sigh) Oh well,
    it's a wish.

    @devdanzin
    Copy link
    Mannequin

    devdanzin mannequin commented May 16, 2009

    Would HEADER_ASN1_MAC_H or IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname help?

    @grooverdan
    Copy link
    Mannequin

    grooverdan mannequin commented Aug 31, 2009

    The changeset that changed the definitions is here:
    http://cvs.openssl.org/chngview?cn=12024 (2004-Mar-14 23:15:13 (UTC))

    As you can see there is no easy identifier in the changeset (i'm not
    sure how portable an ifdef on a typedef is (possible
    asn1_const_ctx_st/ASN1_const_CTX)).

    The patch i've done goes of then next OPENSSL_VERSION_NUMBER change
    which occurred here
    http://cvs.openssl.org/filediff?f=openssl/crypto/opensslv.h&v1=1.36.2.35&v2=1.36.2.36
    (2004/03/17 11:40:44) ~3 days later.

    Same patch applies to p3k

    @florentx
    Copy link
    Mannequin

    florentx mannequin commented Jan 10, 2010

    Still occurs on dev and py3k.
    And patch applies correctly.

    @florentx
    Copy link
    Mannequin

    florentx mannequin commented Jan 10, 2010

    It occurs on Debian Lenny AMD64.

    @vstinner
    Copy link
    Member

    vstinner commented Mar 2, 2010

    I commited grooverdan's patch: r78596 (trunk), r78597 (2.6), r78598 (py3k), 78599 (3.1).

    The API was changed in... 2004, 6 years ago! I hope that everybody upgraded to the new OpenSSL version since that. Anyway, the warning should be fixed, and Python should be compatible with any OpenSSL version.

    @vstinner vstinner closed this as completed Mar 2, 2010
    @warsaw
    Copy link
    Member

    warsaw commented Mar 3, 2010

    Because we're in release candidate mode, I reverted the change to the release26-maint branch. It doesn't seem critical enough to sneak in between rc and final. Please do re-apply after 2.6.5 final is released though!

    @vstinner
    Copy link
    Member

    vstinner commented Mar 3, 2010

    barry> Because we're in release candidate mode,
    barry> I reverted the change to the release26-maint branch.

    Yeah, sorry. I realized that after backporting the fix to 2.6.

    barry> Please do re-apply after 2.6.5 final is released though!

    Ok. I reopened to issue to not forget.

    @vstinner vstinner reopened this Mar 3, 2010
    @florentx
    Copy link
    Mannequin

    florentx mannequin commented Mar 4, 2010

    On Gentoo buildbots (2.x and 3.x), there's still the same compiler warnings:
    http://www.python.org/dev/buildbot/all/builders/x86%20gentoo%20trunk/builds/5899

    /home/buildslave/python-trunk/trunk.norwitz-x86/build/Modules/_ssl.c:706: warning: passing arg 2 of `ASN1_item_d2i' from incompatible pointer type
    /home/buildslave/python-trunk/trunk.norwitz-x86/build/Modules/_ssl.c:710: warning: passing arg 2 of pointer to function from incompatible pointer type

    @pitrou
    Copy link
    Member

    pitrou commented Jan 6, 2011

    I don't get any warnings with gcc -Wall and OpenSSL 1.0.x.

    @pitrou pitrou closed this as completed Jan 6, 2011
    @grooverdan
    Copy link
    Mannequin

    grooverdan mannequin commented Jan 6, 2011

    out of date?

    still occurs on:
    AMD64 Leopard 2.7: http://www.python.org/dev/buildbot/all/builders/AMD64 Leopard 2.7/builds/308/steps/compile/logs/warnings (57)
    PPC Leopard 2.7: http://www.python.org/dev/buildbot/all/builders/PPC Leopard 2.7/builds/532/steps/compile/logs/warnings (20)
    PPC Tiger 2.7: http://www.python.org/dev/buildbot/all/builders/PPC Tiger 2.7/builds/532/steps/compile/logs/warnings (25)

    PPC Leopard 3.1: http://www.python.org/dev/buildbot/all/builders/PPC Leopard 3.1/builds/674/steps/compile/logs/warnings (20)
    x86 gentoo 3.1 : http://www.python.org/dev/buildbot/all/builders/x86 gentoo 3.1/builds/1412/steps/compile/logs/warnings (8)
    x86 FreeBSD 3.1: http://www.python.org/dev/buildbot/all/builders/x86 FreeBSD 3.1/builds/719/steps/compile/logs/warnings (7)
    3.1.dmg: http://www.python.org/dev/buildbot/all/builders/3.1.dmg/builds/339/steps/compile/logs/warnings (20)

    btw I don't think the gentoo ones are accurate - old versions of openssl have been gone for a while:
    http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/openssl/openssl-0.9.7m.ebuild?hideattic=0&view=log

    @pitrou
    Copy link
    Member

    pitrou commented Jan 7, 2011

    Well, it merely means that OpenSSL has changed the const-ness of some of their APIs over time. As I said I see no warnings with the most recent OpenSSL versions. Buildbots will tell you the same story: for example, no warnings under OS X "Snow Leopard", some under OS X "Leopard" (which is older).

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants