From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2509 invoked by alias); 7 Mar 2006 16:52:07 -0000 Received: (qmail 2498 invoked by uid 22791); 7 Mar 2006 16:52:06 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-vbr2.xs4all.nl (HELO smtp-vbr2.xs4all.nl) (194.109.24.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 07 Mar 2006 16:52:04 +0000 Received: from webmail.xs4all.nl (dovemail6.xs4all.nl [194.109.26.8]) by smtp-vbr2.xs4all.nl (8.13.3/8.13.3) with ESMTP id k27GpwcP017350; Tue, 7 Mar 2006 17:51:59 +0100 (CET) (envelope-from mark.kettenis@xs4all.nl) Received: from 192.87.1.22 (SquirrelMail authenticated user sibelius) by webmail.xs4all.nl with HTTP; Tue, 7 Mar 2006 17:51:59 +0100 (CET) Message-ID: <15758.192.87.1.22.1141750319.squirrel@webmail.xs4all.nl> In-Reply-To: <200603071519.38581.paul@codesourcery.com> References: <200603061518.23469.paul@codesourcery.com> <200603071421.08416.paul@codesourcery.com> <22344.192.87.1.22.1141741508.squirrel@webmail.xs4all.nl> <200603071519.38581.paul@codesourcery.com> Date: Tue, 07 Mar 2006 18:45:00 -0000 Subject: Re: [patch] Avoid gcc specific compiler flags From: "Mark Kettenis" To: "Paul Brook" Cc: "Mark Kettenis" , gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00115.txt.bz2 >> I was talking about the following fragment: >> >> + set nowarnings [lsearch -exact $options nowarnings] >> + if {$nowarnings != -1} { >> + if [target_info exists gdb,nowarnings_flag] { >> + set flag "additional_flags=[target_info gdb,nowarnings_flag]" >> + } else { >> + set flag "additional_flags=-w" >> + } >> + set options [lreplace $options $nowarnings $nowarnings $flag] >> >> There's a double $nowarnings on that last line. or is that intentional? >> In that case I don't understand this code completely, and it needs a >> comment to explain it. > > That's deliberate. > > The code replaces the "nowarnings" option with > additional_flags=[something] > $nowarnings is the index of the nowarnings option in the list of options. > The lreplace function replaces a range of list items. In this case we want > to > replace a single list element so the start and end of the range are the > same. > > I've added the following comment and applied the patch. > > # Replace the "nowarnings" option with the appropriate additional_flags > # to disable compiler warnings. That sounds good to me! Please commit. Mark