From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75616 invoked by alias); 24 Jun 2018 06:13:56 -0000 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 Received: (qmail 75580 invoked by uid 89); 24 Jun 2018 06:13:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*i:sk:5B2EB76, H*f:sk:5B2EB76 X-HELO: mail-io0-f179.google.com Received: from mail-io0-f179.google.com (HELO mail-io0-f179.google.com) (209.85.223.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 24 Jun 2018 06:13:50 +0000 Received: by mail-io0-f179.google.com with SMTP id d185-v6so9633368ioe.0 for ; Sat, 23 Jun 2018 23:13:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A99sNzTbLBE+dAqGEsiIKIqJYMsJXr2dtmNiuQg9T4s=; b=Zkiqv8dF7rGllCfXJvsJfOt+fTs87jwyzCJ4vnnlyIUN3J6K4mRX1F2prDTFl+8d+p QLMdMJsrP41xD1UTnMBadLe6fQU5wcmvPZye/vTDe0cLHWhrFRxwDyJ32p+v+WEkPBi/ TD1m91EnLKsUvRI6INM0XFo3gRohwq/TLei75e4z1GgE/JoOce83KuHY7PtqK8k5BeJt KWCKT5ujAD+w+diQ1XWzraQ4UA/kCCtsfDq3r3hB39DKRm6VXP6d7sHS77r5txeD6K0k 5qmodseDSueCThX3ohVOjJC1TjHYkAtBitpC17eFrWYwaXB7EwxHD4TQvsfvX/A02iMU F1mA== X-Gm-Message-State: APt69E1vLxIDR8A5VcvZNAGEZbkgbLzePicVncw8BJMYvc9+Ev4yVVrE L/MEpVW6o7nqVKWz5CD8ncU94M/hF6JbXX+ClESGCw== X-Google-Smtp-Source: AAOMgpdtou0X+hIZkasQavYz69gm8xGzqXJPWxhTKeLj3DW/8Mylq+R1ulHjZQK5dHTArVOn7guyJAGODhHSPIDyxxY= X-Received: by 2002:a6b:9845:: with SMTP id a66-v6mr6545948ioe.82.1529820829176; Sat, 23 Jun 2018 23:13:49 -0700 (PDT) MIME-Version: 1.0 References: <5B2E3145.8030000@mutluit.com> <5B2E9EA1.6040508@mutluit.com> <5B2EB760.3070902@mutluit.com> In-Reply-To: <5B2EB760.3070902@mutluit.com> From: Jonathan Wakely Date: Sun, 24 Jun 2018 14:46:00 -0000 Message-ID: Subject: Re: 1x -Werror=unused-variable happens :-) To: um@mutluit.com Cc: "gcc@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00251.txt.bz2 On Sat, 23 Jun 2018 at 22:11, U.Mutlu wrote: > > U.Mutlu wrote on 06/23/2018 09:25 PM: > > Jonathan Wakely wrote on 06/23/2018 07:14 PM: > >> On Sat, 23 Jun 2018 at 12:39, U.Mutlu wrote: > >>> > >>> Hi, > >>> when building the languages=c,c++ with "-g0 -DNDEBUG", then the following > >>> error happens: > >>> > >>> ../../../gcc_trunk/libitm/method-serial.cc: In member function 'void > >>> GTM::gtm_thread::serialirr_mode()': > >>> ../../../gcc_trunk/libitm/method-serial.cc:309:12: error: unused variable 'ok' > >>> [-Werror=unused-variable] > >>> bool ok = disp->trycommit (priv_time); > >>> ^~ > >>> > >>> Of course one can get rid of it by giving also -Wno-error=unused-variable. > >>> > >>> > >>> But nevertheless, someone more knowledgeable should check & possibly fix that > >>> assert related error: > >>> > >>> bool ok = disp->trycommit (priv_time); > >>> // Given that we're already serial, the trycommit better work. > >>> assert (ok); > >>> > >>> I think maybe so: > >>> > >>> // Given that we're already serial, the trycommit better work. > >>> #ifndef NDEBUG > >>> const bool ok = disp->trycommit (priv_time); > >>> assert (ok); > >>> #else > >>> disp->trycommit (priv_time); > >>> #endif > >> > >> No, because now the statement has to be maintained twice. This is what > >> __attribute__((unused)) is for. > > > > Yes, true, got it. > > > >> This belongs in bugzilla really, not this mailing list. > > > > Ok, I'll do it shortly, after getting an account there first :-) > > Ok, bug report has just been filed, together with the above hint on how to fix it: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86293 Thanks! > Btw, of course I could fix that simple thing also myself, but I'm a newbie > here :-), > and I think I don't have svn write access as I haven't applied for it yet. > >