From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50328 invoked by alias); 24 Nov 2015 20:03:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 49985 invoked by uid 89); 24 Nov 2015 20:03:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 24 Nov 2015 20:03:26 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 4DBBC33EAB1 for ; Tue, 24 Nov 2015 20:03:25 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-91.phx2.redhat.com [10.3.113.91]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAOK3Our005502; Tue, 24 Nov 2015 15:03:25 -0500 Subject: Re: [PATCH 01/02] PR/62314: add ability to add fixit-hints To: David Malcolm References: <1447173325-48683-1-git-send-email-dmalcolm@redhat.com> <564CF44F.4010204@redhat.com> <1447885546.19594.117.camel@surprise> Cc: gcc-patches@gcc.gnu.org From: Jeff Law Message-ID: <5654C28C.3020500@redhat.com> Date: Tue, 24 Nov 2015 20:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447885546.19594.117.camel@surprise> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02955.txt.bz2 On 11/18/2015 03:25 PM, David Malcolm wrote: > >> What is the purpose of the #if 0 code in the various tests? Did you >> mean to leave those in? > > Presumably you're referring to the bodies of the functions > test_fixit_insert > test_fixit_remove > test_fixit_replace > within: > gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-bw.c > gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-color.c > > where the bodies are purely of the form: > { > #if 0 > some code, containing dejagnu directives. > #endif > } Yes. Those are the ones I'm referring to, I should have been more explicit. > > Although this looks weird, it's deliberate, and follows the pattern > earlier in those test files: the diagnostics are injected by the plugin, > not by cc1. The plugin gives us a way of unit-testing how > diagnostic_show_locus handles the various ways of calling into the > diagnostic API, isolating it from the details of any particular real > diagnostic in cc1, and from the details of how to get real > location/range information. *must* *remember* *this* *stuff* *is* *different*. So essentially the code is there to mimick, to some degree, what we're going to warn for via the diagnostic API. The code itself isn't of any real interest other than, essentially, documenting roughly what kidn of code we'd be warning about. *must* *remember* *this* *stuff* *is* *different* :-) > > Does the above address your concerns? (Joesph already approved the > other patch) Yes. This is good to go into the trunk. jeff