From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9453 invoked by alias); 10 Dec 2010 14:18:04 -0000 Received: (qmail 9439 invoked by uid 22791); 10 Dec 2010 14:18:03 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_CP X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Dec 2010 14:17:59 +0000 Received: by wyj26 with SMTP id 26so3697472wyj.0 for ; Fri, 10 Dec 2010 06:17:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.74.68 with SMTP id w46mr107422wed.86.1291990676628; Fri, 10 Dec 2010 06:17:56 -0800 (PST) Received: by 10.216.47.73 with HTTP; Fri, 10 Dec 2010 06:17:56 -0800 (PST) In-Reply-To: <20101208052206.GF15607@bubble.grove.modra.org> References: <20101208052206.GF15607@bubble.grove.modra.org> Date: Fri, 10 Dec 2010 14:18:00 -0000 Message-ID: Subject: Re: nlmconv.c - warning: value computed is not used From: Bernd Jendrissek To: binutils Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00391.txt.bz2 On Wed, Dec 8, 2010 at 7:22 AM, Alan Modra wrote: > On Wed, Dec 08, 2010 at 01:03:55AM +0200, Bernd Jendrissek wrote: >> In message <477B8342.60604@redhat.com> Nick Clifton wrote: >> > =A0 strncpy (nlm_variable_header (outbfd)->oldThreadName, " LONG", >> > =A0 =A0 =A0 =A0NLM_OLD_THREAD_NAME_LENGTH); >> > >> >[snip other alternative] >> >> This is it in my case. > > I wonder do you have a fancy macro for strncpy on your system? =A0What > does the preprocessor output look like here? Bingo. This is what GCC (4.3.1 with an early-2000s glibc) sees on my syste= m: (__extension__ (__builtin_constant_p (" LONG") && __builtin_constant_p (5) ? (strlen (" LONG") + 1 >=3D ((size_t) (5)) ? (char *) memcpy ((((outbfd) -> tdata.nlm_obj_data) -> nlm_variable_hdr)->oldThreadName, " LONG", 5) : strncpy ((((outbfd) -> tdata.nlm_obj_data) -> nlm_variable_hdr)->oldThreadName, " LONG", 5)) : strncpy ((((outbfd) -> tdata.nlm_obj_data) -> nlm_variable_hdr)->oldThreadName, " LONG", 5))); Casting the call to strncpy to (void) makes the warning go away. I'm sure this is a non-issue on more recent systems. Thanks for the hint.