Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68063 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 771 invoked from network); 3 Jul 2013 22:59:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2013 22:59:18 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.143 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.143 smtp143.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.143] ([67.192.241.143:51889] helo=smtp143.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/23-15343-4CCA4D15 for ; Wed, 03 Jul 2013 18:59:17 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp24.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 3C3EB180137; Wed, 3 Jul 2013 18:59:14 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp24.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id E6EA518011B; Wed, 3 Jul 2013 18:59:13 -0400 (EDT) Message-ID: <51D4ACC1.3040908@sugarcrm.com> Date: Wed, 03 Jul 2013 15:59:13 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Anthony Ferrara CC: Christopher Jones , "internals@lists.php.net" References: <51D46AA9.6040108@oracle.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] String Size Refactor Progress From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > The problem is that changing 's' from int to size_t can (and does) cause > segfaults. But if we refactor string lengths to be size_t, we can not allow code that still relies on it being int, if sizeof(size_t) != sizeof(int). It would just produce wrong length. I'd actually prefer segfault there at least for testing phase because segfault is obvious while wrong length would be much harder to catch. > We can have the discussion if 's' and 'p' should remain there (and if the > compile time option should be there) at merge time, but for now the switch > just makes life easier making the change. It wasn't designed for a > long-term switch... OK, if it's a temp measure, that's fine, but if we're taking strings to use size_t, then in the final code it should use size_t in the API functions everywhere, otherwise there would be a lot of weird bugs. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227