Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 2 Jan 2002 05:33:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 2 Jan 2002 05:33:00 -0500 Received: from mail.s.netic.de ([212.9.160.11]:22021 "EHLO mail.netic.de") by vger.kernel.org with ESMTP id ; Wed, 2 Jan 2002 05:32:45 -0500 To: Momchil Velikov Cc: linux-kernel@vger.kernel.org, gcc@gcc.gnu.org, linuxppc-dev@lists.linuxppc.org Subject: Re: [PATCH] C undefined behavior fix In-Reply-To: <87g05py8qq.fsf@fadata.bg> From: Florian Weimer Date: Wed, 02 Jan 2002 11:29:20 +0100 In-Reply-To: <87g05py8qq.fsf@fadata.bg> (Momchil Velikov's message of "02 Jan 2002 01:03:25 +0200") Message-ID: <87y9jh3v27.fsf@deneb.enyo.de> Lines: 8 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Momchil Velikov writes: > - strcpy(namep, RELOC("linux,phandle")); > + memcpy (namep, RELOC("linux,phandle"), sizeof("linux,phandle")); Doesn't this still trigger undefined behavior, as far as the C standard is concerned? It's probably a better idea to fix the linker, so that it performs proper relocation. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/