From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id LeOgJmy+VmOTIRAAWB0awg (envelope-from ) for ; Mon, 24 Oct 2022 12:33:48 -0400 Received: by simark.ca (Postfix, from userid 112) id 960151E112; Mon, 24 Oct 2022 12:33:48 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=R+4j8Jvl; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4779E1E0D3 for ; Mon, 24 Oct 2022 12:33:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB2FE3857B86 for ; Mon, 24 Oct 2022 16:33:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB2FE3857B86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666629228; bh=et1gxLp4FXI2ICr/wFS5f10HKARiUY3/s/czOxJhd6k=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=R+4j8Jvl/JmXIe7XhxNdayOoDOJFGq7rhZl1bmF0N7zcivTnrLVd+bbNToFpFXerC /s8WK5h4i6TnXAaKAQPhjzaq6hTO/gkwyi7dQ1PDfkMXzSXmIv9heerWmaNHHmREpT GRscpcA+20NTbHvDC56wc2zi41knpTXNZlVoqB1U= 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 A79D03858421 for ; Mon, 24 Oct 2022 16:33:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A79D03858421 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-367-HX8TT938N0uo0opkueeIiA-1; Mon, 24 Oct 2022 12:33:24 -0400 X-MC-Unique: HX8TT938N0uo0opkueeIiA-1 Received: by mail-qk1-f197.google.com with SMTP id de21-20020a05620a371500b006eed31abb72so9309144qkb.6 for ; Mon, 24 Oct 2022 09:33:23 -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=et1gxLp4FXI2ICr/wFS5f10HKARiUY3/s/czOxJhd6k=; b=qtYlsT32dcza+TWuDpzVdO/zIF1jbRjx0pgH4FBtfcbEBtz5Yo7R+5zEvifo3dZHmZ t81Jlfle+8Eh9V3TdVNRG9E6MRC5n4XCdmh27WHpdEDXVemMsv6oWNTVCpbXRBWwqTBT T5HgoBdTVi8PbxXBfs5G4HKCADMdzJdKSk0SP54nUI/frlpuS3oezZYedsqpOH2ID8L0 y3BxApLUQO8vvs/fYblErGpNDOpZGaQKhcZEu9EKWMZdTEoZ483Yw5LnR7hYceNM1nLb IWvz7dwcbkfZ0+Lqh6U/6PKh+ogT3H1m2OZhtERyLjuLTKeoRw3Uw9uyYm6Rfua8seqA 0Ngg== X-Gm-Message-State: ACrzQf3hSkb5U293r4sX+sVr0LWWzO77pykG54Y28pYW9TWsOyZrIPmo 3bo9wAENYj+7G/E7zEpghWaM0HgPwMhNKgLKIw9w02n1lJXwC95qU6c7EmlkQnl1CYfXtfO+hx7 JqzEpKl4OAorfA5ljGmP3ZQ== X-Received: by 2002:ac8:57cd:0:b0:39c:bb4c:565b with SMTP id w13-20020ac857cd000000b0039cbb4c565bmr27817926qta.115.1666629203399; Mon, 24 Oct 2022 09:33:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5lB8wN5hH32N0MLrCbUBzuaeuIZlg9dYJfq5IN2z/ttbZnBGKyOUu0NlG+BTZ/P6UHUrY0Pg== X-Received: by 2002:ac8:57cd:0:b0:39c:bb4c:565b with SMTP id w13-20020ac857cd000000b0039cbb4c565bmr27817913qta.115.1666629203184; Mon, 24 Oct 2022 09:33:23 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id y14-20020a05620a44ce00b006ce76811a07sm243641qkp.75.2022.10.24.09.33.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 09:33:22 -0700 (PDT) To: Tsukasa OI , Tsukasa OI , Mike Frysinger , Nick Clifton Subject: Re: [PATCH 31/40] sim/ppc: Initialize help variables In-Reply-To: <91681f1c5c0144e59196ec40e456f214cc74568d.1666258361.git.research_trasio@irq.a4lg.com> References: <91681f1c5c0144e59196ec40e456f214cc74568d.1666258361.git.research_trasio@irq.a4lg.com> Date: Mon, 24 Oct 2022 17:33:21 +0100 Message-ID: <87v8o96v1q.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Tsukasa OI writes: > GCC / Clang generate a warning if a variables is used uninitialized on some > cases. On the default configuration, it causes a build failure (unless > "--disable-werror" is specified). > > This commit initializes two help variables with { 0 }. I've not pushed my fix as I'd like to reach consensus before merging anything. But I agree with Mike here, initializing help here just so that it can be used somewhere it's not needed seems like the wrong solution. Thanks, Andrew > --- > sim/ppc/hw_sem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sim/ppc/hw_sem.c b/sim/ppc/hw_sem.c > index 937e2ad6f81..034191b10b7 100644 > --- a/sim/ppc/hw_sem.c > +++ b/sim/ppc/hw_sem.c > @@ -109,7 +109,7 @@ hw_sem_init_data(device *me) > hw_sem_device *sem = (hw_sem_device*)device_data(me); > const device_unit *d; > int status; > - union semun help; > + union semun help = { 0 }; > > /* initialize the properties of the sem */ > > @@ -188,7 +188,7 @@ hw_sem_io_read_buffer(device *me, > struct sembuf sb; > int status; > uint32_t u32; > - union semun help; > + union semun help = { 0 }; > > /* do we need to worry about out of range addresses? */ > > -- > 2.34.1