From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16404 invoked by alias); 9 Jun 2009 19:45:42 -0000 Received: (qmail 16364 invoked by uid 22791); 9 Jun 2009 19:45:36 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-116-tuesday.nerim.net (HELO maiev.nerim.net) (62.4.16.116) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Jun 2009 19:45:27 +0000 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by maiev.nerim.net (Postfix) with ESMTP id 334C4B81B3; Tue, 9 Jun 2009 21:45:24 +0200 (CEST) Received: from glinka.lesours ([192.168.0.1]) by hector.lesours with esmtp (Exim 4.69) (envelope-from ) id 1ME7G9-0001NY-Nf; Tue, 09 Jun 2009 21:45:25 +0200 Message-ID: <4A2EBBDC.7000909@starynkevitch.net> Date: Tue, 09 Jun 2009 19:45:00 -0000 From: Basile STARYNKEVITCH User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Taras Glek CC: gcc@gcc.gnu.org Subject: Re: plugin callbacks after compiler errors References: <4A2EB8F4.2080003@gmail.com> In-Reply-To: <4A2EB8F4.2080003@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00200.txt.bz2 Taras Glek wrote: > While developing my plugin I've noticed that many callbacks need to be > guarded with "if (errorcount)" or the plugin will cause a gcc crash > due to receiving less complete data than it expected. > > Should the plugin API guard callbacks in invoke_plugin_callbacks() to > avoid 99% of plugins running into this issue? I am not sure this should be a fixed, wired (ie built-in) policy. One could imagine some plugins whose main role is precisely to issue additional errors (and IIRC, your TreeHydra did something similar to that). Maybe we should just fix the documentation, saying that plugins should care (and plugin writers should think of) previously detected errors. Maybe we might differentiate errors found by other passes and error found by plugins. Maybe we should also extend the API so that some plugins get disabled when errorcount is >0. I tend to believe it should not become a general policy (but at least tunable plugin by plugin) but I may be wrong. Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***