From patchwork Thu Sep 30 19:27:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan-Benedict Glaw X-Patchwork-Id: 45620 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 17EDB3857C69 for ; Thu, 30 Sep 2021 19:28:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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-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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! Configuring GCC with --target=avr-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 -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/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/config/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_decoded_option*, location_t)': [all 2021-09-30 00:43:47] ../../gcc/gcc/common/config/avr/avr-common.c:80:72: error: unused parameter 'loc' [-Werror=unused-parameter] [all 2021-09-30 00:43:47] 80 | const struct cl_decoded_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. Ok for trunk? Thanks, Jan-Benedict 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_optimization_table[] = 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 = decoded->value;