From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id B71D8385800E for ; Wed, 2 Feb 2022 20:44:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B71D8385800E Received: by mail-wr1-x435.google.com with SMTP id v13so788581wrv.10 for ; Wed, 02 Feb 2022 12:44:37 -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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vJSj6ZjPSpDTvXyuSB7/hU+YHWcLcNp1h7enb/7hqjo=; b=Ll2f7VlKk0/k49hSstqFJTHPk4oBDGGfqzqAm2i+LSzfPP6TK+mTgku+Qr+08zOvzG KrU9dbdL1uG7knBk/ObA0KpXOqzJGKshrffltI9srdPjVSB2zNdrue6Ts/lvmOdVKstW r6axNqjMHwmSHlhuLqDdzbZih+2qM91Gf3R0jh17w5sEK7lKMHhWM2dH/7Z/hwK4hNGy fOhOuJhoH/bM+E+Ui3ZizvpcZem1zlSILYCTUOHplOCOTMQd+dKSnmtFvpymjgbrN5Ul 7BvfQlabi9Z8sTpRtwWSZsz+1Hat2VwiQmwIKgfqjldnk0ftT1pX9ZoX9Tkvb+B9Xepm h8ig== X-Gm-Message-State: AOAM533EYkx+Mw7+acwOvnnpl/ilmJZzU/ng4bgUZcaz121hxjVcNiGp D+QZXcA3bG3ELukSkMJUGeayQT4zo4ClXjSWcvQ= X-Google-Smtp-Source: ABdhPJzmyT/k6CKEAhaLZd9y8Z5w5W/YS1bVvJY26LVH6wT1QAusyDQYNQxQ2+jutkw47x/sjFG2uOzyUfU7l1zeYqs= X-Received: by 2002:a5d:6da7:: with SMTP id u7mr25950073wrs.152.1643834676446; Wed, 02 Feb 2022 12:44:36 -0800 (PST) MIME-Version: 1.0 References: <8d42151f-7be2-4d67-5b46-a83ba55d5c1c@redhat.com> <20220128152748.GD614@gate.crashing.org> <478a5194-c8aa-2be7-e4aa-f0d441cbfac0@gmail.com> <20220202183334.GA614@gate.crashing.org> In-Reply-To: <20220202183334.GA614@gate.crashing.org> From: Jonathan Wakely Date: Wed, 2 Feb 2022 20:44:25 +0000 Message-ID: Subject: Re: Potentially false-positive -Wstringop-overflow= warning with gcc >= 11.1 To: Segher Boessenkool Cc: Martin Sebor , Martin Sebor via Gcc-help , Dumitru Ceara , Richard Sandiford Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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, 02 Feb 2022 20:44:39 -0000 On Wed, 2 Feb 2022 at 18:35, Segher Boessenkool wrote: > > On Wed, Feb 02, 2022 at 10:12:44AM +0000, Jonathan Wakely wrote: > > On Tue, 1 Feb 2022 at 23:55, Martin Sebor via Gcc-help > > > There's plenty of literature out there that explains this, including > > > the GCC manual, so I'd expect most C/C++ programmers to understand > > > that. > > > > I disagree. So does the manual: > > > > -Warray-bounds > > -Warray-bounds=n > > This option is only active when -ftree-vrp is active > > (default for -O2 and above). It > > warns about subscripts to arrays that are always out of > > bounds. This warning is > > enabled by -Wall. > > Yes, that is wrong as written. Please open a PR? Done: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104355