public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Denis Chertykov <chertykov@gmail.com>, gcc-patches@gcc.gnu.org
Subject: [AVR] Fix unused argument warning
Date: Thu, 30 Sep 2021 21:27:23 +0200	[thread overview]
Message-ID: <20210930192723.hbh2nemcsm55bxig@lug-owl.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 2466 bytes --]

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.



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;
 


  Ok for trunk?

Thanks,
  Jan-Benedict

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

             reply	other threads:[~2021-09-30 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 19:27 Jan-Benedict Glaw [this message]
2021-10-05 14:46 ` PING: " Jan-Benedict Glaw
2021-10-05 14:53   ` Jeff Law
2021-10-05 15:03     ` Jan-Benedict Glaw
2021-10-05 15:06       ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210930192723.hbh2nemcsm55bxig@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=chertykov@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).