From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mengyan1223.wang (mengyan1223.wang [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 1BB883858416 for ; Wed, 12 Jan 2022 08:32:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1BB883858416 Received: from [IPv6:240e:358:114e:8f00:dc73:854d:832e:3] (unknown [IPv6:240e:358:114e:8f00:dc73:854d:832e:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id 03197663AB; Wed, 12 Jan 2022 03:32:05 -0500 (EST) Message-ID: Subject: Re: Better diagnostic for shadowed function? From: Xi Ruoyao To: NightStrike , gcc-help Date: Wed, 12 Jan 2022 16:32:00 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3030.1 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2022 08:32:11 -0000 On Wed, 2022-01-12 at 01:33 -0500, NightStrike via Gcc-help wrote: > I recently hit this problem: > > #include > 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 School of Aerospace Science and Technology, Xidian University