From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbWDXWcG (ORCPT ); Mon, 24 Apr 2006 18:32:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751150AbWDXWcG (ORCPT ); Mon, 24 Apr 2006 18:32:06 -0400 Received: from pproxy.gmail.com ([64.233.166.181]:58696 "EHLO pproxy.gmail.com") by vger.kernel.org with ESMTP id S1751336AbWDXWcF convert rfc822-to-8bit (ORCPT ); Mon, 24 Apr 2006 18:32:05 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VSmsn9JgwU5brgZTlxfFsrbu+g4euQcitbNslsvV9rDqAsUdY6Rs3noAnIk7zCUjzwL60gaUBk8Dw/WKBcIfvz59xOs7UIfrP+LJE8Im0f8Ztso11zUqDvU0k79yp2NZrBbdQpONOSvC4jpqIkcFCI00dlipeG+acH+N5JkeVP8= Message-ID: Date: Mon, 24 Apr 2006 15:32:04 -0700 From: "Joshua Hudson" To: linux-kernel@vger.kernel.org Subject: Re: Compiling C++ modules In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Content-Disposition: inline References: <1145911546.1635.54.camel@localhost.localdomain> <444D3D32.1010104@argo.co.il> <9f7850090604241450w885fa98v36657ba5f12f071c@mail.gmail.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On 4/24/06, Martin Mares wrote: > Hello! > > > Oh, and yeah, a = b + c *is* more readable than > > > > a = malloc(strlen(b) + strlen(c)); > > strcpy(a,b); > > strcat(a,c); > > > > and contains fewer bugs ;) > > Actually, it contains at least the bug you have made in your C example, > that is forgetting that malloc() can fail. So can string addition, if > allocated dynamically. > > Have a nice fortnight The C++ code *still* contains fewer bugs. I didn't see the malloc() one, but there is another.