From patchwork Wed Nov 12 14:54:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= X-Patchwork-Id: 410000 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E91851400AB for ; Thu, 13 Nov 2014 01:55:19 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; q=dns; s= default; b=DhygPu/DsUez9LxHiOhPa3DfXdPMhWrYgt0ADglw/0Lxn6sk5DZCd wswjnM364QkeqMwjh4Co3OTMfRoLIsVs533SjRd1gN+wRZRTJhP9s6HbYNwVsC6H 4AOR7M0bGEmt2IWuhk5uDF/QPguxwHKh4VcPL+OjURCnmCoaN80lUo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; s= default; bh=ZEIxhJtmsegJRXu1o9DLlSyGAwU=; b=x8TG611ivVbGvHWigelM oRW4K76LAYwoPaEhjkkcw8sG5YtF3E6VIE9gzjwkziXKYTk3QZVz6pg0VammBCnu UDISOu1EZ6FEvUbilf1mFBj3fNmRTCS/O9x7hkVPOxVBbLdXEpkCMnlMfpQo2fF6 zq8kJ4/xxwRFUm9fYaycrD8= Received: (qmail 32046 invoked by alias); 12 Nov 2014 14:55:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 32032 invoked by uid 89); 12 Nov 2014 14:55:12 -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-wi0-f178.google.com Received: from mail-wi0-f178.google.com (HELO mail-wi0-f178.google.com) (209.85.212.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 12 Nov 2014 14:55:11 +0000 Received: by mail-wi0-f178.google.com with SMTP id bs8so5129416wib.5 for ; Wed, 12 Nov 2014 06:55:08 -0800 (PST) X-Received: by 10.195.13.14 with SMTP id eu14mr62577222wjd.31.1415804106243; Wed, 12 Nov 2014 06:55:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.217.80.73 with HTTP; Wed, 12 Nov 2014 06:54:45 -0800 (PST) In-Reply-To: <20141112143843.GK29791@redhat.com> References: <20141112143843.GK29791@redhat.com> From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Wed, 12 Nov 2014 15:54:45 +0100 Message-ID: Subject: Re: [PR c/52952] More precise locations within format strings To: Marek Polacek Cc: Andreas Schwab , Gcc Patch List , "Joseph S. Myers" , Dodji Seketeli , Jason Merrill On 12 November 2014 15:38, Marek Polacek wrote: > On Wed, Nov 12, 2014 at 03:35:06PM +0100, Manuel López-Ibáñez wrote: >> > ../../libcpp/line-map.c:667:65: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] >> >> I just (r217418) bootstrapped this code and it did not produce this >> error (or warning). Could you give more details? > > Have you tried the bootstrap without checking enabled? Indeed, the error is due to linemap_assert definition. My patch just exposes the bug. This should fix it: (It really sucks that libcpp and by extension line-map cannot use gcc code: gcc_checking_assert was already correct. What a boring duplicated effort!) I can commit the above as obvious tonite (if no one else takes care of fixing it before me). Cheers, Manuel. Index: line-map.h =================================================================== --- line-map.h (revision 217418) +++ line-map.h (working copy) @@ -584,11 +584,12 @@ bool linemap_location_from_macro_expansi the replacement-list of a macro expansion. */ #define linemap_check_ordinary(LINE_MAP) __extension__ \ ({linemap_assert (!linemap_macro_expansion_map_p (LINE_MAP)); \ (LINE_MAP);}) #else -#define linemap_assert(EXPR) +/* Include EXPR, so that unused variable warnings do not occur. */ +#define linemap_assert(EXPR) ((void)(0 && (EXPR))) #define linemap_check_ordinary(LINE_MAP) (LINE_MAP) #endif /* Encode and return a source_location from a column number. The source line considered is the last source line used to call