From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 803353858401 for ; Tue, 11 Oct 2022 14:20:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 803353858401 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-329-Sj960PFSOpev4GhgP_2qyw-1; Tue, 11 Oct 2022 10:20:33 -0400 X-MC-Unique: Sj960PFSOpev4GhgP_2qyw-1 Received: by mail-wm1-f70.google.com with SMTP id d5-20020a05600c34c500b003b4fb42ccdeso10672282wmq.8 for ; Tue, 11 Oct 2022 07:20:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=P9QrOFdnEol7JImYMbdQyJU3d/ErBsj3wZDjGJ1eKWc=; b=ykuBS1Gpm6Mi3HNWMWHo+E6rcslj7BCVGv1hQtWjLEvXfAn7CF1N5qY9MecrJ6aKSi CeNooAZVKVrRhfZxJ2Xc9YTa1YKbTtsGoyuE2Ic7iRZJICcGudfHDIu3Dw+MqDcpleIZ Mk60XfwaN3k4YPZgda6yjD8NjfuaE9AVvGFsA1uQc/lJ5RnbAC/Ol48iL35Eakh3syeN MJpqygwIsJHnjV5DwoPU574SSh7wTdz8lEifb6lvCR6O+jWsres67TcFDa2ULHVqJ/xu YzGX1Y7kdhoHxz1vr5hF4ttr2ACew5N427jqWeUhLSJIoZWcI/b1bf0voXA0aebzpLYO 3HYg== X-Gm-Message-State: ACrzQf0ZDZWQkktloVxMbZKQ7FzxvvAH0MKWTMutWDzWjLXJAjblFZX1 iQw3HzH2fbyvJaCFHXxlLX51D3EUKq02bSxQQmo83Blfvda0b4PiEBI3tN7oQieGWurRXnFDdyl DpeMR19bB3Cyb4Lxjs/IqMA== X-Received: by 2002:adf:dd04:0:b0:22e:4671:f092 with SMTP id a4-20020adfdd04000000b0022e4671f092mr15128277wrm.604.1665498031711; Tue, 11 Oct 2022 07:20:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5pRgN3OZrVH/W3V6e3/3/Q7o/5niQkdn2G30CDX1EN3SCxe5mZ0HPnMqwmGoNCZSrsyNR9Ag== X-Received: by 2002:adf:dd04:0:b0:22e:4671:f092 with SMTP id a4-20020adfdd04000000b0022e4671f092mr15128265wrm.604.1665498031484; Tue, 11 Oct 2022 07:20:31 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id bh17-20020a05600c3d1100b003c6cc57566fsm731181wmb.14.2022.10.11.07.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 07:20:31 -0700 (PDT) From: Andrew Burgess To: Tsukasa OI , Tsukasa OI , Mike Frysinger Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v3 0/5] sim: Suppress warnings if built with Clang In-Reply-To: References: Date: Tue, 11 Oct 2022 15:20:30 +0100 Message-ID: <87k056cuhd.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2022 14:20:41 -0000 Tsukasa OI writes: > Hello, > > This is the version 2 patchset to suppress Clang compiler warnings > (causes a build failure due to default -Werror). > > > [Background] > > When we build Binutils and GDB with Clang, it causes a build failure due to > warnings generated by Clang and the default -Werror configuration. > > I MOSTLY managed to make ALL ARCHITECTURE ENABLED Binutils and GDB > -Werror-free on Clang 15.0.0 (note that this does not necessarily mean > warning-free) and this patchset is a part of it (common simulator parts). > > - It still requires -Wno-implicit-function-declaration on the > LatticeMicro32 and M32R simulators. Except them, most of Binutils / GDB > components can be built with Clang by default with my tree. > - I noticed that the assembler is not tested enough (because just with > --enable-targets=all, it builds only host assembler). > > Full Clang 15.0.0 -Werror-free branch in development is available at: > > > Tested configuration: > - Ubuntu 22.04.1 LTS (x86_64) > - LLVM / Clang 15.0.0 (built from source) > - Configuration examples: > $srcdir/configure \ > --enable-targets=all \ > --enable-multilib --enable-ld --enable-gold --enable-nls \ > CC=clang CXX=clang++ CCLD=clang CXXLD=clang++ \ > CFLAGS=' -O2 -g -Wno-implicit-function-declaration' \ > CXXFLAGS='-O2 -g -Wno-implicit-function-declaration' > $srcdir/configure \ > --target=riscv64-unknown-linux-gnu \ > --enable-multilib --enable-ld --enable-gold --enable-nls \ > CC=clang CXX=clang++ CCLD=clang CXXLD=clang++ \ > CFLAGS='-O2 -g' CXXFLAGS='-O2 -g' > > > [About this Patchset] > > This patchset contains four five fixes to the files under sim{,/common}. > Each contains minor fixes to suppress Clang / GCC warnings. > > Each change is detailed in the each patch. > > > [Changes: v2 -> v3] > > - PATCH 2/5: Rewritten predicate macros from (!!x) to (x != 0). > (This is based on the feedback by Andrew Burgess). > - PATCH 3/5: Replaced with a patch by Andrew Burgess > (slightly modified by me). > - PATCH 4/5: Fix cached variable from ld_cv_* to sim_cv_*. > - Removed ChangeLog from commit messages > (based on the feedback [to another patchset by me] by Bruno Larsen). > > > [Changes: v1 -> v2] > > - Commit messages are improved > - PATCH v1 1/4 is Moved to another patchset > - PATCH v1 2-4/4 -> PATCH v2 1-3/5 > - New: Check known getopt definition on sim (PATCH v2 4/5) > This test is already performed on binutils, gas, gprof and ld and this > commit does the same to sim. > - New: Initialize pbb_br_* by default (PATCH v2 5/5) > It did not generate warnings on Clang but GCC creates some warnings > (although those are not reported as errors). > This is due to uninitialized pbb_br_* variables and this commit fixes > the issue by initializing them by a harmless value. Thanks for the updated patches. I reviewed these and pushed them with a couple of minor updates, I'll follow up to each patch with the changes I made. Thanks, Andrew