From: Xi Ruoyao <xry111@mengyan1223.wang>
To: NightStrike <nightstrike@gmail.com>, gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Better diagnostic for shadowed function?
Date: Wed, 12 Jan 2022 16:32:00 +0800 [thread overview]
Message-ID: <ee576fa2c5f0eaa295c8bdc93e5ff31e9a056b99.camel@mengyan1223.wang> (raw)
In-Reply-To: <CAF1jjLssVerFV=9M_6U56w9Q4BczvGpPTYaDwn9m3NabtnZjgQ@mail.gmail.com>
On Wed, 2022-01-12 at 01:33 -0500, NightStrike via Gcc-help wrote:
> I recently hit this problem:
>
> #include <strings.h>
> void f() {
> index[0] = 0;
> }
>
> #gcc is 11.2.0
> gcc -c a.c
> a.c:4:7: error: subscripted value is neither array nor pointer nor
> vector
> 4 | index[1] = 0;
> | ^
>
> -Wshadow (or all or extra) did not highlight that "index" was actually
> a function from strings.h.
It has nothing to do with -Wshadow, because nothing is shadowed.
> For the future, is there anything I could
> have done to make gcc tell me what the real error was?
Open an issue in https://gcc.gnu.org/bugzilla and hope someone will pick
it up :).
--
Xi Ruoyao <xry111@mengyan1223.wang>
School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2022-01-12 8:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 6:33 NightStrike
2022-01-12 8:32 ` Xi Ruoyao [this message]
2022-01-12 10:06 ` Jonathan Wakely
2022-01-12 18:36 ` NightStrike
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=ee576fa2c5f0eaa295c8bdc93e5ff31e9a056b99.camel@mengyan1223.wang \
--to=xry111@mengyan1223.wang \
--cc=gcc-help@gcc.gnu.org \
--cc=nightstrike@gmail.com \
/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).