From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17139 invoked by alias); 9 May 2012 14:58:27 -0000 Received: (qmail 17126 invoked by uid 22791); 9 May 2012 14:58:26 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausc60pc101.us.dell.com (HELO ausc60pc101.us.dell.com) (143.166.85.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 May 2012 14:58:13 +0000 X-Loopcount0: from 10.175.216.249 From: To: CC: , , Subject: Re: [RFA] Emit a warning for ineffective set VAR = EXP command Date: Wed, 09 May 2012 14:58:00 -0000 Message-ID: <4B067100-86F0-4977-A6DC-CECB3F7C8B05@Dell.com> References: <8781499A-A489-42D0-80B1-75136331DBDB@adacore.com> <20120507193824.GW15555@adacore.com> <419AD66E-6D21-40D6-97FE-1FF387117B7D@adacore.com> <46C50B2C-7910-4B36-B64B-D1C6C91627B8@dell.com> In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-ID: <081FBD8BE6D46640BDD9006E511B0A04@dell.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00274.txt.bz2 On May 9, 2012, at 10:12 AM, Maciej W. Rozycki wrote: > On Wed, 9 May 2012, Paul_Koning@Dell.com wrote: >=20 >>>> I think we should avoid the warning for pre/post inc/dec. This >>>> type of expression might be a little outside the method proposed >>>> in our documentation, but I think it's still a perfectly valid >>>> expression that results in an assignment being performed. >>>=20 >>> I don't know who should approve this adjustment, but here is the versio= n that deals with pre/post inc/dec. >>> Note that it still warns for expressions such as i++ * 2. >>=20 >> If you had it walk through the elts[] list, would it then work for that = case? >=20 > What do you mean by "work" here? I think a warning for "i++ * 2" is=20 > expected as that's questionable use -- the result of the multiplication i= s=20 > discarded. Did you mean anything else? You're right, but it does perform an assignment (to "i") so a message sayin= g that the statement has no effect is not accurate. Then again, given that= the statement doesn't make much sense, the fact that the message is not co= mpletely accurate isn't all that interesting -- unlike the simple "i++" it = isn't a likely case in reality. paul