From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23055 invoked by alias); 16 May 2014 16:29:39 -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 22917 invoked by uid 89); 16 May 2014 16:29:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f170.google.com Received: from mail-we0-f170.google.com (HELO mail-we0-f170.google.com) (74.125.82.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 16 May 2014 16:29:37 +0000 Received: by mail-we0-f170.google.com with SMTP id u57so2850791wes.29 for ; Fri, 16 May 2014 09:29:34 -0700 (PDT) X-Received: by 10.194.82.9 with SMTP id e9mr14843537wjy.45.1400257773999; Fri, 16 May 2014 09:29:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.89.4 with HTTP; Fri, 16 May 2014 09:29:13 -0700 (PDT) From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Fri, 16 May 2014 16:29:00 -0000 Message-ID: Subject: Re: [PATCH 2/5] c_diagnostic_ignored_function hack To: Tom Tromey Cc: Gcc Patch List Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-05/txt/msg01301.txt.bz2 > This patch makes it possible to suppress the function-name display in > a straightforward way: it adds a new global which the plugin can set > to declare the name of the dummy function. > > This patch seems like a bit of a hack, but there didn't seem to be a > notably cleaner approach. Can't you override the diagnostic_starter() in your plugin? This way you can even customize it to print "gdb" in the prefix (if you wish to provide a custom prefix). If that is possible, that seems way cleaner. If not, I wonder why not. Otherwise, why not override the lang_hook itself? This way the plugin can provide its own lang_hook so that your proposed c_print_error_function lives in the plugin itself. I'm probably missing something obvious here. Cheers, Manuel.