Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77643 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32346 invoked from network); 26 Sep 2014 06:57:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2014 06:57:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.173 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.173 mail-vc0-f173.google.com Received: from [209.85.220.173] ([209.85.220.173:47788] helo=mail-vc0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7C/90-27411-95E05245 for ; Fri, 26 Sep 2014 02:57:30 -0400 Received: by mail-vc0-f173.google.com with SMTP id le20so8885422vcb.4 for ; Thu, 25 Sep 2014 23:57:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=aeByIM7rRw0RgUtwlnN+0K4NcK34Ekd7frkMDi1v1Sk=; b=C3DhBAxrh7KrUuZT8bq0FoXEzfSosbfeKmhx+c02ixJj7NXfQOQ0WPELUMhxe+lECj PK+PKOi7q7XcqWUJgy/D4IgG67X4dILze83AMH+K0VFx4pXo2rI3GBN00Xoyh5a6i/eG ESAFITTPyrjXGABqPOvCaYcDLgrAWKzDnzDbYEsBGbNl3bqAU4+paHL5WmjKv7SgKgcK MKeVUd+fVkM9hbyGUlPsAD202Nzd98E/iKqLZsHCtIMhxnMDhV19UMeQeaZmmsEt8VHQ aF9OkpdF+iMt4GWkeUyZyy+UqzHuTDptvCcI6VqlE9pri+tMRgwl9c9UhQmmG76194Sy /JOw== X-Gm-Message-State: ALoCoQltVSs0qwxKXJgphmjMR3wqLjUFNDfctO6eK77TCWuEKhBuC9gzXnJdwT7UchySEAifmAVa8+1sjbCDpcLWvoPZ9zK+EIZonVXxfeGaS5ANJ3ODtHJhhtA/gUdm1M1WoWeRrXuinNmsVQGnCjmmA4sHAo/afQ== MIME-Version: 1.0 X-Received: by 10.52.34.104 with SMTP id y8mr226628vdi.37.1411714647194; Thu, 25 Sep 2014 23:57:27 -0700 (PDT) Received: by 10.52.158.197 with HTTP; Thu, 25 Sep 2014 23:57:27 -0700 (PDT) In-Reply-To: <54242A0C.3000309@gmail.com> References: <07153B91-E12F-4B16-ADD7-86CFC75C4642@ajf.me> <54220EB4.60001@sugarcrm.com> <6A21F4EF-476E-476C-A64B-246B8929172B@ajf.me> <5422DD87.80109@gmail.com> <568C0F03-B23B-43FC-963D-6D0D23405E9D@ajf.me> <54230209.2050406@sugarcrm.com> <54233C70.3060604@gmail.com> <54236D16.3070401@sugarcrm.com> <54242A0C.3000309@gmail.com> Date: Fri, 26 Sep 2014 10:57:27 +0400 Message-ID: To: Rowan Collins Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf30780ab01215200503f26ed1 Subject: Re: [PHP-DEV] [RFC] ZPP Failure On Overflow From: dmitry@zend.com (Dmitry Stogov) --20cf30780ab01215200503f26ed1 Content-Type: text/plain; charset=UTF-8 May be this overflow checks should be optional? In old ages compilers for Wirth family languages had option to enable or disable overflow checks. If option is enabled we may throw an exception, if no - work as today. Any user would be able to chose between compatibility and safety. Thanks. Dmitry. On Thu, Sep 25, 2014 at 6:43 PM, Rowan Collins wrote: > Andrea Faulds wrote (on 25/09/2014): > >> No bogus value ever gets to a function - it always gets INT_MAX on > >> > overflow. If INT_MAX is harmful for this function, this change does > not > >> > help as you could still pass INT_MAX and this change would not do > anything. > >> > > No it won't. Normally it truncates (module), only some functions cap. > > I saw that in the RFC, and thought it rather odd that a more sane > implementation already exists, but functions have to opt in to use it. > > I thought perhaps it was a side-effect of something else, but > README.PARAMETER_PARSING_API doesn't list any other difference between "l" > and "L": > > > l - long (long) > > L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long) > > What was the original motivation for functions to have that choice? > -- > Rowan Collins > [IMSoP] > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --20cf30780ab01215200503f26ed1--