From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qOBoO29xB2NVFS0AWB0awg (envelope-from ) for ; Thu, 25 Aug 2022 08:56:15 -0400 Received: by simark.ca (Postfix, from userid 112) id EF8121E4A7; Thu, 25 Aug 2022 08:56:15 -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=Stf4wLX1; 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 8E5EA1E21F for ; Thu, 25 Aug 2022 08:56:15 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D08DA385277E for ; Thu, 25 Aug 2022 12:56:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D08DA385277E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1661432174; bh=J2pcogAvlcKr63QdjYz39I/kB+oEWYclFnvindDiaK8=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Stf4wLX1JI2JW7uqq/ZnqDa0UyFFNFFWUDXyZcu9Cb3mzAtWwVES3lq6UVn8QjoC0 eo5UMwbXZLHETulfL7n5NZLlFn/M3ykksAeS2hcu7VYSgeXABTBkw85jsZn6ACb7J+ LxKoesvDy5KohVaoFongeHl9fB/+8Wc+KCPgDHKs= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 4A9A03851AAE for ; Thu, 25 Aug 2022 12:55:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A9A03851AAE Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-494-bF7Lne04NYKrL21ehrtvLw-1; Thu, 25 Aug 2022 08:55:52 -0400 X-MC-Unique: bF7Lne04NYKrL21ehrtvLw-1 Received: by mail-wr1-f71.google.com with SMTP id i24-20020adfaad8000000b002251cb5e812so3396449wrc.14 for ; Thu, 25 Aug 2022 05:55:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc; bh=+7hupT7rb8Vpj8X3M6ZRQxgbxV8qUE+98cJgpL96s5U=; b=BwIkhmtEbmXkZ3by7ysXnOTPHQup7/zMFfeshwUIjvqYzB25cvnf8rtPgcv3zL1MtD CfWxvPAJLVsqnLkXHwCGi4oQWLW98GO2yxGr9jzo664axvhNmJiGNwjlavlAyfA8WPYf Ub3/al4rbRrU0BX2Pgxhpzx1MbtOG3efGS37cqd6V+zMPhTlrePc7DnuywHMnx6A6aW4 jxBLg1SmZHEb/9XfXEJRMypyPma66lH7ZY4hywriSd9LOBCcFRMbgeNPp7CI3ePeCddq NuBTN6doYl62tOzRRo7F+5nWIeodT7XKb2z4Ba5I8a+qIwBqnVCZAlFCedzfQ3EOInJO r3Pg== X-Gm-Message-State: ACgBeo0FY+LHqFuNX6CmBsp+ChUQfmSR6Z04rgWmBGOktXLbnkZcDYDA XdnJ0lRyuhoYnpJKY+13WP8uciWViOrZHIzfQVusKGhOiapQxcL0rsu45/gdKUtODt02L5WMo12 gxsW/PUhwKj1V/VMIOyQMAw== X-Received: by 2002:a05:6000:69c:b0:225:3063:381 with SMTP id bo28-20020a056000069c00b0022530630381mr2225252wrb.648.1661432151681; Thu, 25 Aug 2022 05:55:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR4HWlhQwdLsG1N5kUNtX3efdSOnstdZJKMlAlfNNLdDqtp+6YAImSkiZlz21cDafO93CAprpw== X-Received: by 2002:a05:6000:69c:b0:225:3063:381 with SMTP id bo28-20020a056000069c00b0022530630381mr2225242wrb.648.1661432151453; Thu, 25 Aug 2022 05:55:51 -0700 (PDT) Received: from localhost ([31.111.84.229]) by smtp.gmail.com with ESMTPSA id x11-20020a05600c2d0b00b003a5f3f5883dsm4718566wmf.17.2022.08.25.05.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 05:55:51 -0700 (PDT) Date: Thu, 25 Aug 2022 13:55:49 +0100 To: Jan-Benedict Glaw Subject: Re: [PATCH] sim/aarch64: Fix type error in declaration Message-ID: <20220825125549.GA3427@redhat.com> References: <20220825121410.b27gxw7jzbenndbs@lug-owl.de> MIME-Version: 1.0 In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 13:54:59 up 2 days, 2:29, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: Jim Wilson , Nick Clifton , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" * Luis Machado [2022-08-25 13:21:35 +0100]: > On 8/25/22 13:14, Jan-Benedict Glaw wrote: > > Hi! > >=20 > > While building with very recent GCC versions, I noticed these build > > issues for aarch64-{elf,linux-gnu,linux,rtems}: > >=20 > > .../configure --prefix=3D/tmp/gdb-aarch64-elf --target=3Daarch64-elf > > [...] > > make V=3D1 all-gdb > > [...] > > /usr/lib/gcc-snapshot/bin/gcc -DHAVE_CONFIG_H -DWITH_HW=3D1 -DHAVE_D= V_SOCKSER -DDEFAULT_INLINE=3D0 -Wall -Wdeclaration-after-statement -Wpointe= r-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-= subscripts -Wempty-body -Wunused-but-set-parameter -Wno-error=3Dmaybe-unini= tialized -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-st= atement -Wmissing-parameter-type -Wpointer-sign -Wold-style-declaration -We= rror -I. -I/var/lib/laminar/run/gdb-aarch64-elf/1/binutils-gdb/sim/aarch64= -I../common -I/var/lib/laminar/run/gdb-aarch64-elf/1/binutils-gdb/sim/aarc= h64/../common -I../../include -I/var/lib/laminar/run/gdb-aarch64-elf/1/binu= tils-gdb/sim/aarch64/../../include -I../../bfd -I/var/lib/laminar/run/gdb-a= arch64-elf/1/binutils-gdb/sim/aarch64/../../bfd -I../../opcodes -I/var/lib/= laminar/run/gdb-aarch64-elf/1/binutils-gdb/sim/aarch64/../../opcodes -I../.= . -I/var/lib/laminar/run/gdb-aarch64-elf/1/binutils-gdb/sim/aarch64/../../= gnulib/import -I../../gnulib/import -g -O2 -c -o cpustate.o -MT cpustate= .o -MMD -MP -MF .deps/cpustate.Tpo cpustate.c > > cpustate.c:270:1: error: conflicting types for 'aarch64_get_CPSR_bits' = due to enum/integer mismatch; have 'uint32_t(sim_cpu *, FlagMask)' {aka 'un= signed int(struct _sim_cpu *, FlagMask)'} [-Werror=3Denum-int-mismatch] > > 270 | aarch64_get_CPSR_bits (sim_cpu *cpu, FlagMask mask) > > | ^~~~~~~~~~~~~~~~~~~~~ > > In file included from sim-main.h:30, > > from cpustate.c:28: > > cpustate.h:310:20: note: previous declaration of 'aarch64_get_CPSR_bits= ' with type 'uint32_t(sim_cpu *, uint32_t)' {aka 'unsigned int(struct _sim_= cpu *, unsigned int)'} > > 310 | extern uint32_t aarch64_get_CPSR_bits (sim_cpu *, uint32_t= ); > > | ^~~~~~~~~~~~~~~~~~~~~ > > cc1: all warnings being treated as errors > > make[3]: *** [Makefile:509: cpustate.o] Error 1 > > make[3]: Leaving directory '/var/lib/laminar/run/gdb-aarch64-elf/1/binu= tils-gdb/sim/aarch64' > > make[2]: *** [Makefile:1929: all-recursive] Error 1 > > make[2]: Leaving directory '/var/lib/laminar/run/gdb-aarch64-elf/1/binu= tils-gdb/sim' > > make[1]: *** [Makefile:1181: all] Error 2 > > make[1]: Leaving directory '/var/lib/laminar/run/gdb-aarch64-elf/1/binu= tils-gdb/sim' > > make: *** [Makefile:11309: all-sim] Error 2 > >=20 > >=20 > > This fixes the declaration: > >=20 > >=20 > > diff --git a/sim/aarch64/cpustate.h b/sim/aarch64/cpustate.h > > index 1d25b3af15a..94e0bc80333 100644 > > --- a/sim/aarch64/cpustate.h > > +++ b/sim/aarch64/cpustate.h > > @@ -307,7 +307,7 @@ extern void aarch64_save_LR (sim_cpu *); > > /* Flag register accessors. */ > > extern uint32_t aarch64_get_CPSR (sim_cpu *); > > extern void aarch64_set_CPSR (sim_cpu *, uint32_t); > > -extern uint32_t aarch64_get_CPSR_bits (sim_cpu *, uint32_t); > > +extern uint32_t aarch64_get_CPSR_bits (sim_cpu *, FlagMask); > > extern void aarch64_set_CPSR_bits (sim_cpu *, uint32_t, uint3= 2_t); > > extern uint32_t aarch64_test_CPSR_bit (sim_cpu *, FlagMask); > > extern void aarch64_set_CPSR_bit (sim_cpu *, FlagMask); > >=20 > >=20 > > OK to install? > >=20 > > Thanks, > > Jan-Benedict > >=20 >=20 > LGTM. I think Andrew might be able to OK this. Thanks for this fix. Please go ahead and apply it. Thanks, Andrew