Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86137 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97042 invoked from network); 7 May 2015 21:26:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 May 2015 21:26:27 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.176 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.223.176 mail-ie0-f176.google.com Received: from [209.85.223.176] ([209.85.223.176:34367] helo=mail-ie0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/00-31245-188DB455 for ; Thu, 07 May 2015 17:26:25 -0400 Received: by iedfl3 with SMTP id fl3so55819957ied.1 for ; Thu, 07 May 2015 14:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=9+ltH81l+4ZHtmPX7ySvdKtGYpGFDLZDsxD7qc8EqWc=; b=YajrLHxogqC+map0r3pZyd43D0LwVf7NMgq3MwcsLy1LGHdc2NwJOC2EXcvJlgoR1/ e4L5y1+ymHqERIO5bGoHvF47yw1CShNG/w1t3gkzIKJqDBrHUG5NurmvT4ACF5i7/G2a CI6ywa7XJxGgA1EbHbdFE/TLUnm9yN/GvRgShzEVb4DvNCGWqwILjof65Kf2Pbw5ONho t1HCqmaASbuwaXWGiPdoDjOwkfipqtpszpj1av0R4Nh+01UXboHvuJkIqskOzXXyoiOA vHJnys1brIMHjKOxJbloryefTs3u6l/Kl00WkigfNtuYziavg+/1sqitJEHs9KdF1Jwl PQqw== MIME-Version: 1.0 X-Received: by 10.107.133.132 with SMTP id p4mr66964ioi.40.1431033982506; Thu, 07 May 2015 14:26:22 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.79.98.67 with HTTP; Thu, 7 May 2015 14:26:22 -0700 (PDT) In-Reply-To: References: <71A78449-A62C-400D-A01F-5668930A7BED@ajf.me> Date: Thu, 7 May 2015 15:26:22 -0600 X-Google-Sender-Auth: T-74jSGYORgJ9K7l7kZeBSk0TeI Message-ID: To: Nikita Popov Cc: Pierre Joye , Dmitry Stogov , PHP internals , Julien Pauli , Derick Rethans , Andrea Faulds Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Thoughts on C version supported for PHP-Next From: levim@php.net (Levi Morrison) On Thu, May 7, 2015 at 12:28 PM, Nikita Popov wrote: > On Mon, Jul 28, 2014 at 9:41 PM, Pierre Joye wrote= : > >> >> On Jul 28, 2014 9:14 PM, "Dmitry Stogov" wrote: >> > >> > I think opinions about readability are subjective. >> > >> > The real problem, that it'll break compatibility with old uncommon >> > compilers. >> > I'm not sure if new MSVC versions support it, but the one I use - does >> not. >> >> We are working with the vc team to test the c99 (c++11/14 as well) with >> many oss softwares, php included (non core ext). >> >> It could be possible to use c99 from a vc pov but not if we decide to >> release php-next next year. However with the yearly vc release, we could >> make it for Q4/2015. >> > Could you please provide an update on the current situation regarding C99 > support in MSVC? It seems that VS 2013 supports the most important C99 > features [1]. What's our current minimum required vc version? > > [1]: https://msdn.microsoft.com/en-us/library/hh409293.aspx Today I explored what it would take to compile with -std=3Dc90 and -std=3Dc99. We're actually very close to being valid C99 =E2=80=93 we just = need to remove `uint` and `u_char` and define _XOPEN_SOURCE for glibc to expose some POSIX/UNIX stuff. Those same things have to be done for C90 compatibility and remove `//` style comments.c. The function strtoll doesn't exist until C90 and we use it; this means for C90 we have to use _XOPEN_SOURCE=3D600 for glibc to give it to us, but I am unsure how portable this is. Aside from strtoll we already use several features of C99 such as `inline`, ``. In summary: I think we should move to C99 and compile with the -std=3Dc99 flag. There are also features of C99 that would allow us to use zend_string* in internal functions instead of char*; this would be a big win for cleanup since user functions use zend_string* and there is forked logic because of this. This is, of course, dependent on the whether the compilers we intend to support will work with C99. I know that gcc, clang, icc and MS VS 2013 will all work with the basic features of C99 that we use now and expect to use in the future if we move to C99. Are there any other known compilers out there that we should check?