Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82517 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34143 invoked from network); 12 Feb 2015 07:49:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2015 07:49:59 -0000 Authentication-Results: pb1.pair.com header.from=reeze.xia@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=reeze.xia@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: reeze.xia@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:51867] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/D2-13750-02B5CD45 for ; Thu, 12 Feb 2015 02:49:52 -0500 Received: by mail-wi0-f169.google.com with SMTP id em10so2958142wid.0 for ; Wed, 11 Feb 2015 23:49:48 -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:from:date:message-id :subject:to:cc:content-type; bh=Nt9c75Fy/ncxC3LuHainHbxCb0qyeZjxf7C69N7NqoM=; b=PaRriJV3wygXuDAIfNnCDbmw//4p2Y1weITdjEjTWA9Y+1bCFKe9Ic8CZnGhZVcvFw 5iiZNUblbMwzC3orUhtFRs9TaERYgwAJew7MU/LNrEQn42NkKqXyOgZtvOCI5CiyCKG6 9ICCsxSSpSJdcGY3GTsg+dyXANE8BfEHkFoZFahRHgOKWNHe3vedcZ3hzzHo38en3dhf O9+VBgnKMI92jFP2a49y3xrG3F2zpJfoAZew4oyAgHl7/poAnMLuqort+ZNoGXqcdFYQ ad9NhYkzHQikKFxYEpUOMEQBQZFmYeo17vJrBvtnSM2dddetstc4R3HLsmHe2SSVnkLL zwIQ== X-Received: by 10.194.189.138 with SMTP id gi10mr5231537wjc.86.1423727388302; Wed, 11 Feb 2015 23:49:48 -0800 (PST) MIME-Version: 1.0 Sender: reeze.xia@gmail.com Received: by 10.194.193.5 with HTTP; Wed, 11 Feb 2015 23:49:28 -0800 (PST) In-Reply-To: References: Date: Thu, 12 Feb 2015 15:49:28 +0800 X-Google-Sender-Auth: RDLv5OAU-jQu6WaBCNor0IXe1i8 Message-ID: To: Dmitry Stogov Cc: Xinchen Hui , Yasuo Ohgaki , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7bf0d3263ca25f050edf5d34 Subject: Re: Proposal: Introduce a new macro:php_error_docref_ex() From: reeze@php.net (reeze) --047d7bf0d3263ca25f050edf5d34 Content-Type: text/plain; charset=ISO-8859-1 Hi, On 12 February 2015 at 15:30, Dmitry Stogov wrote: > We don't use macros with variable number of arguments in PHP. > this is not portable. > We could don't have to use variadic macros, we could try something like: *+PHPAPI void php_error_doc0(int type, const char *format, ...)* *+{* *+* *va_list args;* *+* *+* *va_start(args, format);* *+* *php_error_docref0(NULL, type, format, args);* *+* *va_end(args);* *+}* *+* *+#define php_error_doc php_error_doc0* *+* > > Thanks. Dmitry. > > On Wed, Feb 11, 2015 at 6:01 PM, reeze wrote: > >> Hi, >> >> On 11 February 2015 at 19:15, Dmitry Stogov wrote: >> >>> Hi, >>> >>> I don't think it'll improve something, and may complicate merging from >>> PHP5 (this is not a big issue, because merging is already not simple). >>> >>> >> Yes it just makes code looks a little better and cleaner. >> >> I didn't realized the merging problem. that might affect diffs which >> changes php_error_docref() >> >> >>> In any case, the names should be swapped, to be used as: >>> >>> php_error_docref(E_WARNING, "recursion detected"); >>> >>> or >>> >>> php_error_docref_ex(NULL, E_WARNING, "recursion detected"); >>> >> >> Yes I prefer this too. >> >> But considering the merging problem, I think I should hold this idea of >> update all of those calls. >> >> We may provider a simple version with default null docref for external >> extesions, but I didn't have proper name for that. >> >> >>> >>> >>> also macros with __VA_ARGS__ may be not portable, s it should be >>> implemented differently. >>> >> >> Yes I should use ##__VA_ARGS__ instead. >> >> >>> Thanks. Dmitry. >>> >>> >>> >>> On Wed, Feb 11, 2015 at 11:41 AM, Xinchen Hui wrote: >>> >>>> Hey: >>>> >>>> On Wed, Feb 11, 2015 at 4:35 PM, Yasuo Ohgaki >>>> wrote: >>>> > Hi all, >>>> > >>>> > On Wed, Feb 11, 2015 at 5:21 PM, reeze wrote: >>>> >> >>>> >> I think it is a cleanup, it works but there are too many >>>> duplication. it >>>> >> is the time to make the code clean and easier to understand. >>>> > >>>> > >>>> > I've never used other than NULL also. >>>> > Everyone is going to remove TSRM macros, it's right time to clean up. >>>> fine, if you want to change.. >>>> >>>> please, _ex means extending, >>>> >>>> so the name should not be php_error_docref_ex... >>>> >>>> thanks >>>> > >>>> > Regards, >>>> > >>>> > -- >>>> > Yasuo Ohgaki >>>> > yohgaki@ohgaki.net >>>> >>>> >>>> >>>> -- >>>> Xinchen Hui >>>> @Laruence >>>> http://www.laruence.com/ >>>> >>> >>> >> >> >> -- >> Reeze Xia >> http://reeze.cn >> > > -- Reeze Xia http://reeze.cn --047d7bf0d3263ca25f050edf5d34--