Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39943 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14526 invoked from network); 13 Aug 2008 23:37:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2008 23:37:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=nlopess@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=nlopess@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.55.154.23 as permitted sender) X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.23 unknown Linux 2.4/2.6 Received: from [212.55.154.23] ([212.55.154.23:42829] helo=sapo.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/C1-05165-15073A84 for ; Wed, 13 Aug 2008 19:37:55 -0400 Received: (qmail 14956 invoked from network); 13 Aug 2008 23:37:51 -0000 Received: from unknown (HELO sapo.pt) (10.134.37.162) by relay3 with SMTP; 13 Aug 2008 23:37:51 -0000 Received: (qmail 31148 invoked from network); 13 Aug 2008 23:37:51 -0000 X-AntiVirus: PTMail-AV 0.3-0.93.0 X-Scan-Status: AV clean (0.00564 seconds); AS clean (0.00023 seconds) Received: from unknown (HELO pc07654) (nunoplopes@sapo.pt@[85.240.54.187]) (envelope-sender ) by mta12 (qmail-ldap-1.03) with SMTP for ; 13 Aug 2008 23:37:51 -0000 Message-ID: <8348C57C721F466882571B6E25A7EFC5@pc07654> To: "Phil Oleson" 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> <48A366CA.9000608@nixil.net> In-Reply-To: <48A366CA.9000608@nixil.net> Date: Thu, 14 Aug 2008 00:37:49 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049 Subject: Re: [PHP-DEV] pspell tweak. From: nlopess@php.net ("Nuno Lopes") >>> 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. Yes sure. I was just warning that compiling foreign C code with a C++ compiler is dangerous because you don't know if it's using some C specific feature or not. Anyway this is already too much offtopic :) Nuno