From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26080 invoked by alias); 14 Dec 2010 08:22:42 -0000 Received: (qmail 26063 invoked by uid 22791); 14 Dec 2010 08:22:40 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from seketeli.net (HELO ms.seketeli.net) (91.121.166.71) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Dec 2010 08:22:32 +0000 Received: from adjoa.torimasen.com (torimasen.com [82.237.12.13]) by ms.seketeli.net (Postfix) with ESMTP id 5C5701608038; Tue, 14 Dec 2010 09:22:30 +0100 (CET) Received: from adjoa.seketeli.net (localhost.localdomain [127.0.0.1]) by adjoa.torimasen.com (Postfix) with ESMTP id C3ABF8E6015; Tue, 14 Dec 2010 09:22:28 +0100 (CET) From: Dodji Seketeli To: Gabriel Dos Reis Cc: Paolo Bonzini , gcc-patches@gcc.gnu.org, tromey@redhat.com, joseph@codesourcery.com, lopezibanez@gmail.com Subject: Re: [PATCH 3/6] Emit macro expansion related diagnostics References: <1291979498-1604-1-git-send-email-dodji@redhat.com> <1291979498-1604-5-git-send-email-dodji@redhat.com> <4D063157.3050901@gnu.org> X-URL: http://www.redhat.com Date: Tue, 14 Dec 2010 08:40:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes 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 X-SW-Source: 2010-12/txt/msg01073.txt.bz2 Gabriel Dos Reis writes: > Let me add some background about this aspect of the diagnostic > machinery. The functions inform(), error(), error_at(), etc. are > offered as some `high-level' building blocks for constructing more > advanced diagnostic functions. It is just that we have not been > very disciplined at factorizing things correctly, and instead we > tend to go for the easier road of `inlining' calls to error() or > inform(). Okay. Thank you for this background. > However, models to look for are print_candidates(), > cxx_print_error_function, the newly introduced > qualified_name_lookup_errorr, etc. I see. Though, some of these functions call below the level error and inform by calling pp_base_set_prefix, pp_verbatim and the like. Are those pp_* calls intended as well? > > The point here is that I would expect CPP to define its own error print > diagnostic function that tracks macro expansion context > (at bit like what what we do with template instantiation contexts) > and combine calls to error_at() and inform(). Okay, so I guess I will move the macro expansion unwinder into CPP and make it and use the CPP diagnostic routines that in turn use c_cpp_error (via the cpp_reader callbacks) that is at the same level as inform() error() etc. I will still have to make default_diagnostic_finalizer call that unwinder to make macro expansion context be printed implicitely, though. > Note also that we don't capitalize diagnostic messages (and they don't end > with periods either.) Thanks. I'll fix that. -- Dodji