From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 21B693858416 for ; Wed, 12 Jan 2022 06:33:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 21B693858416 Received: by mail-ed1-x52f.google.com with SMTP id 30so5784307edv.3 for ; Tue, 11 Jan 2022 22:33:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=lgowcD3OS3YL1GkFAQVwUvJJurTwx7kMXH9fvdziMTs=; b=z94d9N059/Kn1VSr0l1dPFjagU39eHXvjVOPxHElMGDSHGkoe80QUtAKG46nctk7qX udzaekhM3oJAYA9BnQwA7wDf6XKZ1sE7IByUeXGqpzBiR0hmnOwE5uUNYAVNfMCdubM3 PIjxFk/ujlHKNz6pu6NnkCUUjgrOsLF0n9LUhHgtjjJo0tdNX/kBT9wA0HSGgRy8sE6H Bszyuf3TT5Lu+by2djfpoL1v7/a4Npu3JVxiXrdWUmvhQ4Qtar9glELB/+bhiZbyjcVe GX+vyCS+qscckuKeg/Auq7nZ5sWGuaIl6f8R84276qOeVXHnri0+xT2npnBIGELHFM8g yXKQ== X-Gm-Message-State: AOAM530IEmkKIL/T24431HFRYmUdUn0rBc5xbPP+yEVHCevraaDByJux jqBatimNH7C3ojlk5tfAc/zLzvoA8Y0njtrvXAeNPElgaRo= X-Google-Smtp-Source: ABdhPJxLy+O0HfjywRNDMxRbt2WTS6/WZ7FgqvPg61CRkjEA01adH6Zjz36U0Vry/qkUIjSBDTW4wvJ/m6CiElSrH38= X-Received: by 2002:a05:6402:3496:: with SMTP id v22mr7766989edc.347.1641969232625; Tue, 11 Jan 2022 22:33:52 -0800 (PST) MIME-Version: 1.0 From: NightStrike Date: Wed, 12 Jan 2022 01:33:41 -0500 Message-ID: Subject: Better diagnostic for shadowed function? To: gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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-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 06:33:55 -0000 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. For the future, is there anything I could have done to make gcc tell me what the real error was?