Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86144 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83814 invoked from network); 9 May 2015 04:23:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 May 2015 04:23:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.175 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.220.175 mail-qk0-f175.google.com Received: from [209.85.220.175] ([209.85.220.175:34280] helo=mail-qk0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 67/24-41461-4BB8D455 for ; Sat, 09 May 2015 00:23:17 -0400 Received: by qkgx75 with SMTP id x75so60567280qkg.1 for ; Fri, 08 May 2015 21:23:14 -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=vE23RSIiBojHWpfr2eOcNZbXaQzgtroXHjLpGJvlHC8=; b=m3PJvzLCt9Vws4AFa5ekLcnfqhiBMK9FKHDXnFzr9ZY7K2AmOb53KR4sqRDcIG1twO gCf04WG9y0T6W43H96/pUwhQKQbYAHsPvkmUl8C1M3QMLztq2+UwCA3FzdM4Vj5Ip6Sp vXamtzrbJGYv1L4SR/wpr87IsVISL0FYyALpAxsg2Cy4H+aEm56jE5sy1yyJZQRQG6R1 HxxWV7TX6Z50P4yT634/CjWaqdiGtE/mRigJHOnPywnROjy0B+HccV/Q6oHcHJY/ibNU sYhLPtYGRIoHwMyGy19/uqT2p/Em0oZwogVDaJnWBQBKF2VDbt/sAofrakitzQS19qaJ rz+g== MIME-Version: 1.0 X-Received: by 10.140.149.147 with SMTP id 141mr1519903qhv.17.1431145394059; Fri, 08 May 2015 21:23:14 -0700 (PDT) Received: by 10.96.127.166 with HTTP; Fri, 8 May 2015 21:23:13 -0700 (PDT) Received: by 10.96.127.166 with HTTP; Fri, 8 May 2015 21:23:13 -0700 (PDT) In-Reply-To: References: <71A78449-A62C-400D-A01F-5668930A7BED@ajf.me> <554BDC4B.2010808@gmx.de> Date: Sat, 9 May 2015 11:23:13 +0700 Message-ID: To: Levi Morrison Cc: Nikita Popov , Christoph Becker , Dmitry Stogov , Andrea Faulds , Julien Pauli , Derick Rethans , PHP internals Content-Type: multipart/alternative; boundary=001a11376816d5c0c605159e800a Subject: Re: [PHP-DEV] Thoughts on C version supported for PHP-Next From: pierre.php@gmail.com (Pierre Joye) --001a11376816d5c0c605159e800a Content-Type: text/plain; charset=UTF-8 Hi! Thanks! Maybe we can create a repo on github to share them? I can create one, yes I prefer github than PHP's git, much easier to manage, issues, etc Cheers, Pierre On May 9, 2015 11:10 AM, "Levi Morrison" wrote: > On Fri, May 8, 2015 at 7:13 AM, Levi Morrison wrote: > > On Fri, May 8, 2015 at 5:01 AM, Pierre Joye > wrote: > >> On May 8, 2015 4:42 AM, "Christoph Becker" wrote: > >>> > >>> Nikita Popov wrote: > >>> > >>> > [...] What's our current minimum required vc version? > >>> > >>> As of PHP 5.5 at least VC11 (Visual Studio 2012) is required for > Windows > >>> builds. The currently available snapshots of master are also built > with > >>> VC11[1]. > >> > >> We are in the process of testing latest or better said the upcoming next > >> version of VC. > >> > >> However it is a long process. We use a couple of libs to test c99 > support. > >> > >> What could be amazingly helpful, not only for VC, is some sample codes > >> using what we are most likely to use intensively from c99. It will > allow is > >> to valid them against various compilers as well as clearly define what > we > >> can support in the CS, all compilers we are likely to support for 7, > >> including VC, ICC or older GCC. > >> > >> Cheers, > > > > I am quite sure we would use these features: > > > > - compound literals (this would allow for zend_string* at compile time) > > - designated initializers > > > > I'll work on some code examples later today if someone hasn't beaten > > me to it by then. > > Here is a self-contained example of designated initializers: > > struct Point { > int x; > int y; > }; > > int main(void) { > struct Point p = { > .y = 2, > .x = 1, > }; > return !(p.x == 1 && p.y == 2); > } > > And here is compound literals: > > #include > > struct sstring { > size_t len; > char *val; > }; > > static struct sstring str; > > int main(void) { > str = (struct sstring) { > sizeof("hello, world") - 1, > "hello, world" > }; > return !(str.len == sizeof("hello, world") - 1); > } > > > I expect in some cases we may even use them together. This particular > example doesn't really show why, but sometimes we have two uint32_t's > in a row and initializing them with a name helps make the code more > understandable: > > #include > > struct sstring { > size_t len; > char *val; > }; > > static struct sstring str; > > int main(void) { > str = (struct sstring) { > .len = sizeof("hello, world") - 1, > .val = "hello, world", > }; > return !(str.len == sizeof("hello, world") - 1); > } > --001a11376816d5c0c605159e800a--