Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71105 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30587 invoked from network); 12 Jan 2014 21:18:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2014 21:18:48 -0000 Authentication-Results: pb1.pair.com header.from=jakub.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jakub.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.44 as permitted sender) X-PHP-List-Original-Sender: jakub.php@gmail.com X-Host-Fingerprint: 209.85.128.44 mail-qe0-f44.google.com Received: from [209.85.128.44] ([209.85.128.44:37188] helo=mail-qe0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/73-13233-6B603D25 for ; Sun, 12 Jan 2014 16:18:47 -0500 Received: by mail-qe0-f44.google.com with SMTP id df13so1198796qeb.3 for ; Sun, 12 Jan 2014 13:18:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=lB3Klb6qFC/aX/79Oj6RDCYTpur52DtpXtE3BUNGF2o=; b=Z636JrwAY641h0N80tizSsgNFnrr8JQt4hS3b4JTybsbQDi+UOZ9p4GNaI0gLnXCgr OXAy7jTLIErt1nKS7VN+E3TbcyU3agSVF08fw9fFNJ19krO1MNnxvAmv7KABnGCppRNM Gv0JWKarazMZPZz/WuHl8D8S0gLD5zOjzCarrB2PW4pzYpe+8TZ+72LhNEkzraRjwt+b kk/86VFfOhv7R9O361VkLRn1xk/RQ3pXY657FRbsXin1h5rG4wSV/IPMxhBWfvO2Llrn QHz8XxDlQeGcLreutsoaVobNTGEKXBeV2ADJoa90WB8NXQWvQgMvAEnzcaesOuok40Yw 3vKQ== MIME-Version: 1.0 X-Received: by 10.229.14.1 with SMTP id e1mr20114403qca.15.1389561524194; Sun, 12 Jan 2014 13:18:44 -0800 (PST) Sender: jakub.php@gmail.com Received: by 10.224.68.68 with HTTP; Sun, 12 Jan 2014 13:18:44 -0800 (PST) In-Reply-To: <09595ef77b25972feab8e047bebdd37c.squirrel@webmail.klapt.com> References: <10f19e40b03ee19837010a988eb05706.squirrel@webmail.klapt.com> <2e9df2840916d6e72255764a08086e57.squirrel@webmail.klapt.com> <09595ef77b25972feab8e047bebdd37c.squirrel@webmail.klapt.com> Date: Sun, 12 Jan 2014 21:18:44 +0000 X-Google-Sender-Auth: dIasgpoG7g1APYgF1wfxiDguMCU Message-ID: To: Anatol Belski Cc: Hannes Magnusson , Nikita Popov , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=001a113386e80b121804efcc8117 Subject: Re: [PHP-DEV] [RFC] 64 bit platform improvements for string length and integer From: bukka@php.net (Jakub Zelenka) --001a113386e80b121804efcc8117 Content-Type: text/plain; charset=ISO-8859-1 Hi Anatol, On Sat, Jan 11, 2014 at 7:34 PM, Anatol Belski wrote: > If a library expects long, in the new code that's the issue on 32 bit > windows only. So yes, probably the way you describe is plausible, check > PHP_WIN32 and PHP_API_VERSION. Honestly, right at the place where I sit, I > can't remember any library working with long (well, timeval struct and so > on, not really libs). There are int, size_t, int64_t, ... so while the > case you describe is of course possible, it's rather an exception. Usually > a simple runtime range check will be good enough, if needed at all. > > Actually there is one big library where you can find it. It's OpenSSL which is why I was asking about it.. :) There are quite a few places where it's used. The main ones are following: - ASN.1 API functions (I plan to completely wrap it :) ) where it's used for data length. - BIO_ctrl for length parameter (BIO_ctrl is a definition result for many macros like BIO_set_mem_buf, BIO_set_buffer_size, BIO_set_write_buf_size...) - Big numbers - there is a situation a bit more complicated but unsigned long is used (there will be necessary some other checks anyway so it's not an issue) I think that would be good to have a look to the other exts and double check if used libs have long parameters for data lengths. If not, then I agree with you that there is no point to do casting to long with warnings just because of OpenSSL. However it would be good to define in compat header a macro for checking that long != php_int_t . I know that it's currently only _WIN64 but if you implement enabling 64bit on 32bit platform (future scope in the RFC :) ), then there will be an extra definition. Cheers Jakub --001a113386e80b121804efcc8117--