Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39941 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9537 invoked from network); 13 Aug 2008 22:57:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2008 22:57:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=oz@nixil.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=oz@nixil.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain nixil.net designates 161.58.222.1 as permitted sender) X-PHP-List-Original-Sender: oz@nixil.net X-Host-Fingerprint: 161.58.222.1 nixil.net FreeBSD 4.6-4.9 Received: from [161.58.222.1] ([161.58.222.1:3074] helo=nixil.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/E0-05165-1D663A84 for ; Wed, 13 Aug 2008 18:57:21 -0400 Received: from demigorgon.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by nixil.net (8.13.6.20060614/8.13.6) with ESMTP id m7DMvEQS055003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 13 Aug 2008 16:57:16 -0600 (MDT) Message-ID: <48A366CA.9000608@nixil.net> Date: Wed, 13 Aug 2008 16:57:14 -0600 User-Agent: Thunderbird 2.0.0.14 (X11/20080623) MIME-Version: 1.0 To: Nuno Lopes CC: Antony Dovgal , PHP Internals List References: <48A07CE7.7010404@nixil.net> <48A19790.20305@daylessday.org> <48A20148.5050902@nixil.net> <48A29724.2080705@daylessday.org> <48A35AFC.7050900@nixil.net> <2BED3AFE583B418F91C775FFE1C7FBE4@pc07654> In-Reply-To: <2BED3AFE583B418F91C775FFE1C7FBE4@pc07654> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (nixil.net [161.58.222.1]); Wed, 13 Aug 2008 16:57:17 -0600 (MDT) X-Virus-Scanned: ClamAV 0.93.1/8029/Wed Aug 13 15:49:09 2008 on nixil.net X-Virus-Status: Clean Subject: Re: [PHP-DEV] pspell tweak. From: oz@nixil.net (Phil Oleson) Nuno Lopes wrote: >> Antony Dovgal wrote: >>> On 13.08.2008 01:31, Phil Oleson wrote: >>>> Thus the diff -u I sent in.. which resolves the above compiler >>>> failure with g++. >>> >>> Committed, thanks! >>> >>> Btw, how and why did you manage to get g++ compiling plain C code? >> >> umm.. how? >> >> cd ext/pspell >> /usr/local/php5/bin/phpize >> env CC=g++ CFLAGS=-fuse-cxa-atexit ./configure >> --with-php-config=/usr/local/php5/bin/php-config >> make >> >> C++ is a superset of C thus any C code can be complied as C++ as long >> as it doesn't use any >> C++ reserved words. > > That is not true at all, although it's a common misconception. > Just try the following in C and in C++: > printf("sizeof('x') == %d\n", (int)sizeof('x')); > > (hint: they will give you different results). And there are many more > differences.. > > Nuno Yes.. there are some differences, but if your very careful with your typing.. C can be compiled with a C++ compiler. printf("sizeof('x') == %d\n", (int) sizeof((char)'x')); gives the same output of 1, with gcc and g++. I really don't want to be a troll. I still espouse that compiling a C program with a C++ compiler even if you never actually run it that way is a definite advantage to catch type checking problems. -Phil.