From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lug-owl.de (lug-owl.de [IPv6:2a03:4000:10:469::]) by sourceware.org (Postfix) with ESMTP id 781953858C2C for ; Thu, 30 Sep 2021 19:27:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 781953858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de Received: by lug-owl.de (Postfix, from userid 1001) id EC54341EF1; Thu, 30 Sep 2021 21:27:23 +0200 (CEST) Date: Thu, 30 Sep 2021 21:27:23 +0200 From: Jan-Benedict Glaw To: Denis Chertykov , gcc-patches@gcc.gnu.org Subject: [AVR] Fix unused argument warning Message-ID: <20210930192723.hbh2nemcsm55bxig@lug-owl.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gbfdhnrh2jkxrm44" Content-Disposition: inline X-Operating-System: Linux chamaeleon 5.8.0-0.bpo.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 19:27:26 -0000 --gbfdhnrh2jkxrm44 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! Configuring GCC with --target=3Davr-elf --enable-werror-always, I see this warning that's easy to fix. The options are parsed with a lot of #ifdefs and it may actually just be unused. Let's just mark it as such. [all 2021-09-30 00:43:46] /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -= O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasyn= chronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual = -Wno-error=3Dformat-diag -Wmissing-format-attribute -Woverloaded-virtual -p= edantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror= -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I.= =2E/../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc= /../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumbe= r/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o avr-common.o -= MT avr-common.o -MMD -MP -MF ./.deps/avr-common.TPo ../../gcc/gcc/common/co= nfig/avr/avr-common.c [all 2021-09-30 00:43:47] ../../gcc/gcc/common/config/avr/avr-common.c: In = function 'bool avr_handle_option(gcc_options*, gcc_options*, const cl_decod= ed_option*, location_t)': [all 2021-09-30 00:43:47] ../../gcc/gcc/common/config/avr/avr-common.c:80:7= 2: error: unused parameter 'loc' [-Werror=3Dunused-parameter] [all 2021-09-30 00:43:47] 80 | const struct cl_decode= d_option *decoded, location_t loc) [all 2021-09-30 00:43:47] | = ~~~~~~~~~~~^~~ [all 2021-09-30 00:43:47] cc1plus: all warnings being treated as errors [all 2021-09-30 00:43:47] make[1]: *** [Makefile:2420: avr-common.o] Error 1 gcc/ChangeLog: * common/config/avr/avr-common.c (avr_handle_option): Mark argument as ATTRIBUTE_UNUSED. diff --git a/gcc/common/config/avr/avr-common.c b/gcc/common/config/avr/avr= -common.c index 6486659d27c..a6939ad03d3 100644 --- a/gcc/common/config/avr/avr-common.c +++ b/gcc/common/config/avr/avr-common.c @@ -77,7 +77,8 @@ static const struct default_options avr_option_optimizati= on_table[] =3D =20 static bool avr_handle_option (struct gcc_options *opts, struct gcc_options*, - const struct cl_decoded_option *decoded, location_t loc) + const struct cl_decoded_option *decoded, + location_t loc ATTRIBUTE_UNUSED) { int value =3D decoded->value; =20 Ok for trunk? Thanks, Jan-Benedict --=20 --gbfdhnrh2jkxrm44 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQlDTvPcScNjKREqWEdvV51g5nhuwUCYVYPlwAKCRAdvV51g5nh uwBVAJsF9KpyCY7PkuGt1S7zXP/guQCl/gCeJmUGVm0ogKCwXplBIitA1CeM98Y= =rqDr -----END PGP SIGNATURE----- --gbfdhnrh2jkxrm44--