Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55667 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97289 invoked from network); 29 Sep 2011 18:11:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Sep 2011 18:11:51 -0000 Authentication-Results: pb1.pair.com header.from=php@hristov.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@hristov.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hristov.com from 91.196.124.214 cause and error) X-PHP-List-Original-Sender: php@hristov.com X-Host-Fingerprint: 91.196.124.214 more.superhosting.bg Linux 2.6 Received: from [91.196.124.214] ([91.196.124.214:51651] helo=more.superhosting.bg) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/92-15741-6E4B48E4 for ; Thu, 29 Sep 2011 14:11:50 -0400 Received: from e180000038.adsl.alicedsl.de ([85.180.0.38] helo=[192.168.130.117]) by more.superhosting.bg with esmtpa (Exim 4.69) (envelope-from ) id 1R9L5F-0004hg-QL; Thu, 29 Sep 2011 21:11:45 +0300 Message-ID: <4E84B4DE.3070904@hristov.com> Date: Thu, 29 Sep 2011 20:11:42 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13 ThunderBrowse/3.8 MIME-Version: 1.0 To: =?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?= CC: Olivier Favre , internals@lists.php.net References: <4E848B31.2030501@gmail.com> <4E84A73E.8030601@gmail.com> In-Reply-To: <4E84A73E.8030601@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - more.superhosting.bg X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] Cast trap with INI entries compiling C++ extension From: php@hristov.com (Andrey Hristov) On 09/29/2011 07:13 PM, Ángel González wrote: > On 29/09/11 17:42, Olivier Favre wrote: >> I checked with a tiny test program, you're right about GCC complaining. >> The right fix is to make the field const (I don't know about const >> keyword). >> G++ won't give warnings, no error would be triggered by a broken fix. >> >> By the way, const char* and char const* are the same, you probably >> meant char * const. > Is it? > I never remember which one is a mutable pointer of const chars and which > the const pointer of mutable chars so I relied on the description at > http://stackoverflow.com/questions/162480/const-in-c#answer-162504 > before sending the mail. > > it's easy, whatever const is closer to is immutable const char * is a pointer to a const char, because the const is closer to the char than to the pointer. char * const is a const pointer to a char, because the const is closer to the pointer than to the char. Anyway, never used char const *, which will conflict with my explanation :) Best, Andrey