From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 43BDE38618BB for ; Wed, 16 Jun 2021 17:52:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 43BDE38618BB Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6D566340E12; Wed, 16 Jun 2021 17:52:16 +0000 (UTC) Date: Wed, 16 Jun 2021 13:52:15 -0400 From: Mike Frysinger To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH/committed 2/2] sim: mn10300: enable -Werror Message-ID: Mail-Followup-To: Simon Marchi , gdb-patches@sourceware.org References: <20210615034733.28752-1-vapier@gentoo.org> <20210615034733.28752-2-vapier@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 16 Jun 2021 17:52:18 -0000 On 16 Jun 2021 11:47, Simon Marchi wrote: > On 2021-06-16 11:35 a.m., Simon Marchi via Gdb-patches wrote: > > On 2021-06-14 11:47 p.m., Mike Frysinger via Gdb-patches wrote: > >> Now that all warnings are fixed in this port, enable -Werror by defaul= t. > >=20 > > I get: > >=20 > > $ gcc --version > > gcc (GCC) 11.1.0 > > $ ccache gcc -DHAVE_CONFIG_H -DWITH_TARGET_WORD_BITSIZE=3D32 -DWITH_T= ARGET_WORD_MSB=3D31 -DWITH_TARGET_BYTE_ORDER=3DBFD_ENDIAN_LITTLE -DWITH_HW= =3D1 -DHAVE_DV_SOCKSER -DDEFAULT_INLINE=3D0 -DWITH_RESERVED_BITS=3D1 -Wall= -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -= Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-= prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-t= ype -Wold-style-declaration -Werror -I. -I/home/simark/src/binutils-gdb/si= m/mn10300 -I../common -I/home/simark/src/binutils-gdb/sim/mn10300/../common= -I../../include -I/home/simark/src/binutils-gdb/sim/mn10300/../../include = -I../../bfd -I/home/simark/src/binutils-gdb/sim/mn10300/../../bfd -I../../o= pcodes -I/home/simark/src/binutils-gdb/sim/mn10300/../../opcodes -I../.. -= I/home/simark/src/binutils-gdb/sim/mn10300/../../gnulib/import -I../../gnul= ib/import -DPOLL_QUIT_INTERVAL=3D0x20 -g3 -O0 -fsanitize=3Daddress -fmax-er= rors=3D1 -fdiagnostics-color=3Dalways -c -o idecode.o -MT idecode.o -MMD = -MP -MF .deps/idecode.Tpo idecode.c > > In file included from /home/simark/src/binutils-gdb/sim/mn10300/sim-mai= n.h:47, > > from /home/simark/src/binutils-gdb/sim/mn10300/../comm= on/sim-inline.c:33, > > from idecode.c:26: > > /home/simark/src/binutils-gdb/sim/mn10300/mn10300_sim.h:189:1: error: = =E2=80=98dw2u64=E2=80=99 defined but not used [-Werror=3Dunused-function] > > 189 | dw2u64 (dword data) > > | ^~~~~~ >=20 > This fixes it for me, I guess that INLINE is undefined at this point. > I don't see any reason not to use "inline". looks like the failure only comes up with -O0: #if defined (__GNUC__) && defined (__OPTIMIZE__) #define INLINE __inline__ #else =20 #define INLINE /*inline*/ #endif we could use INLINE2 here instead as it doesn't check OPTIMIZE. -mike