Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69471 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92839 invoked from network); 3 Oct 2013 03:01:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2013 03:01:56 -0000 Authentication-Results: pb1.pair.com header.from=william.a.bartlett@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=william.a.bartlett@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.43 as permitted sender) X-PHP-List-Original-Sender: william.a.bartlett@gmail.com X-Host-Fingerprint: 209.85.219.43 mail-oa0-f43.google.com Received: from [209.85.219.43] ([209.85.219.43:48993] helo=mail-oa0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/93-23255-22EDC425 for ; Wed, 02 Oct 2013 23:01:55 -0400 Received: by mail-oa0-f43.google.com with SMTP id f4so1754650oah.16 for ; Wed, 02 Oct 2013 20:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=EQ21VmPXvw9qrce0FsWJ+9K7K9MijVL1HR4METlMszw=; b=RFGSizf12JWLK2NiMp7ufpKTA/Pi9gwAroi1bZ5/1jOVAYi14Rghy+4st6XUWDNHay 46pHEESNkOV/ro+9d8CAEeiSs1hkhlTGg89tygO0QZ6MlnNSezCNRDV7tMfq+Aatahwg i9aMb/asE7mW7P0Tb+/SZxVe8grzK4OvwjdxRtKfQwz5bb6TNzJpVxlRgioUKeRRwxaZ YTxz00HOwxrCHoh1k/zuwdZZM820/q8NglGT8GK8BpyhS4YNAIBkzF/oT40M+9hW3D94 fXIY3YGtmqa+gp7LvA8t6llcGgig6+vWUBnQAotQj63hV1CRLmQcSle0ot5aAEzTgzEz W9dg== MIME-Version: 1.0 X-Received: by 10.60.142.8 with SMTP id rs8mr8918267oeb.34.1380769311806; Wed, 02 Oct 2013 20:01:51 -0700 (PDT) Received: by 10.60.34.164 with HTTP; Wed, 2 Oct 2013 20:01:51 -0700 (PDT) In-Reply-To: References: Date: Wed, 2 Oct 2013 23:01:51 -0400 Message-ID: To: Jakub Zelenka Cc: PHP internals list , andrey@php.net Content-Type: multipart/alternative; boundary=047d7b33cd7458df0e04e7cd6853 Subject: Re: [PHP-DEV] Streams constify API change in master leads to compilation warning for extensions From: william.a.bartlett@gmail.com (William Bartlett) --047d7b33cd7458df0e04e7cd6853 Content-Type: text/plain; charset=ISO-8859-1 My understanding is that the const triggers some optimizations because the compiler better understands how the variables are used. I'm not sure what degree of a difference it makes, but I'm always a fan of using const if it's appropriate. Perhaps your effort is better spent modifying the extensions to not emit warnings? I would be concerned if there were compilation errors rather than warnings. -- William Bartlett College of Engineering | Cornell University '14 240-432-5189 On Wed, Oct 2, 2013 at 2:41 PM, Jakub Zelenka wrote: > Hi, > > I was wondering why stream API has been changed in this commit: > > > https://github.com/php/php-src/commit/92d27ccb0574f901a107409a7fec92888fa2b82f > > Basically all char pointers have been constified. The thing is that this > commit leads to compilation warning for many extensions. > > In my case I use php_stream_locate_url_wrapper and want to compile my > extension (fann) without any warnings. Because this change is in master and > not in 5.5-, I will have to add some ifdefs and cast it for 5.6+. > > The thing is that php_stream_locate_url_wrapper and other stream fuctions > are often used for function parameters from zend_parse_parameters which are > just char *. Then the values have to be casted. > > I understand that APIs should be improved and sometimes changes are > necessary but in this case I have to ask a question. Was this change worthy > to compilation warnings for many extensions? > > If not would it be possible to revert it? > > Thanks > > Jakub > --047d7b33cd7458df0e04e7cd6853--