From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24544 invoked by alias); 13 Dec 2010 14:44:54 -0000 Received: (qmail 24535 invoked by uid 22791); 13 Dec 2010 14:44:53 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Dec 2010 14:44:50 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PS9dr-0006eR-Ep for gcc-patches@gcc.gnu.org; Mon, 13 Dec 2010 15:44:43 +0100 Received: from 93-34-198-173.ip51.fastwebnet.it ([93.34.198.173]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Dec 2010 15:44:43 +0100 Received: from bonzini by 93-34-198-173.ip51.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Dec 2010 15:44:43 +0100 To: gcc-patches@gcc.gnu.org From: Paolo Bonzini Subject: Re: [PATCH 3/6] Emit macro expansion related diagnostics Date: Mon, 13 Dec 2010 15:38:00 -0000 Message-ID: <4D063157.3050901@gnu.org> References: <1291979498-1604-1-git-send-email-dodji@redhat.com> <1291979498-1604-5-git-send-email-dodji@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: gcc-patches@gcc.gnu.org, tromey@redhat.com, joseph@codesourcery.com, gdr@integrable-solutions.net, lopezibanez@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.6 In-Reply-To: <1291979498-1604-5-git-send-email-dodji@redhat.com> 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/msg00991.txt.bz2 Message-ID: <20101213153800.GFvAHapUcS65R3MVROJ7cJ2YIjj4gfiwdppzCYsTZd4@z> On 12/10/2010 12:11 PM, Dodji Seketeli wrote: > [dodji@adjoa gcc]$ ./cc1 -quiet -ftrack-macro-expansion test.c > test.c: In function ‘g’: > test.c:5:14: error: invalid operands to binary<< (have ‘double’ and ‘int’) > In macro 'OPERATE' at test.c:2:9 > Expanded at test.c:5:3 > In macro 'SHIFTL' at test.c:5:14 > Expanded at test.c:8:3 > In macro 'MULT' at test.c:8:3 > Expanded at test.c:13:3 > I'm not sure I share Jeff's doubts about the location to present. Possibly _this_ could be controlled by a flag, though. Also, I know this is just an RFC, but the error message should probably look like either this example: test.c:5:14: error: invalid operands to binary<< (have ‘double’ and ‘int’) test.c:2:9: note: in expansion of macro 'OPERATE' test.c:5:3: note: expanded from here test.c:5:14: note: in expansion of macro 'SHIFTL' test.c:8:3: note: expanded from here test.c:8:3: note: in expansion of macro 'MULT' test.c:13:3: note: expanded from here or this shorter example: test.c:5:14: error: invalid operands to binary<< (have ‘double’ and ‘int’) test.c:2:9: note: while expanding macro 'OPERATE' test.c:5:14: note: while expanding macro 'SHIFTL' test.c:8:3: note: while expanding macro 'MULT' test.c:13:3: note: expanded from here or this that does not change the location compared to current GCC: test.c:13:3: error: invalid operands to binary<< (have ‘double’ and ‘int’) test.c:2:9: note: while expanding macro 'OPERATE' test.c:5:14: note: while expanding macro 'SHIFTL' test.c:8:3: note: while expanding macro 'MULT' Paolo