From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id BBA7D3858D1E for ; Mon, 30 Jan 2023 23:16:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BBA7D3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x633.google.com with SMTP id me3so36653317ejb.7 for ; Mon, 30 Jan 2023 15:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nqypagy33io7pqMNMbRz+yiYjo0anm3LkIRLAKRxkrM=; b=augeVoHvU0/F9UQLQwQC1yQ20mWMry01T2K3gkM2EKQ7WGIPS7piIm8Gr2Srcacc1o LsoPi3ciywmGzvsnWbwVHkNovsk8IZma7xDzVRZ1flfaR8LrUb1srjQxh/KZm9nbWpge +80stpPwNiFVx/ZjLgGb8Hn0cpDhjPwSXJwnaTcxjh6zmi5H7WUUdpPbCpG5WJLUAa6F N6WQfg/gNe4EtQI0IKn4tqnZDrkknniZEwhi+vbm2LGsU/6xJpGlAcwECPFvzk/dWtIv BBPGtK3Faym9ViO4vuDrDLa7zBepZHJMsdk2XOBPtKs6Hl8cXdRGjkyhQOkNpbh2/7Bf VQRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nqypagy33io7pqMNMbRz+yiYjo0anm3LkIRLAKRxkrM=; b=Ch3kxoHfa0QQaCI6MqDGwDlvZl1OQ4QfV1IOxV5FieNL0q1MqdkD3tI5l3b146fYhD 55vhpcmty31UHEROKBOPUW2qGgldgMgWM9bkUo7r3WyxTICXZyqAdDgryMm7IdLX7j74 lLPulutBAn47zpJF8HWR/L+tcczLpkEytsbxhdbJDGsZS8RTImSnip04Z5BD5XrHuak8 j3vt/F8szd5U0N2WwAPti2YmKa1zVu7Ine6qN7NOqJNguML6/YmF4KWgbmvTHGSADVjx yFicNRxZJ6sN+Hqk1igkZ8OIy7EJ5aqWzSD3WCdOxTR2rTaGmVpCBTFrv/BZWksl1t4I GITw== X-Gm-Message-State: AO0yUKWou4reM9J9E5OnVnj2zviGI5/2VyGA8A8XghfNl2mqagZf91vn 1aYC41gWddrLGvsIiY3zNM+aUMylGlCNbNlqAgIL81bnc04= X-Google-Smtp-Source: AK7set8hTp9zDc7Gylg7U9JVPtKFwlB/D1VVTTuQI1+JJG3tNkn5dMWa7K9gGR1nBkvbLiFlqt07s6SDVDJhBgdmpJo= X-Received: by 2002:a17:906:2854:b0:88a:4a5f:ccd7 with SMTP id s20-20020a170906285400b0088a4a5fccd7mr1015056ejc.94.1675120609164; Mon, 30 Jan 2023 15:16:49 -0800 (PST) MIME-Version: 1.0 References: <20230130230959.GW25951@gate.crashing.org> In-Reply-To: <20230130230959.GW25951@gate.crashing.org> From: Patrick Herbst Date: Mon, 30 Jan 2023 18:16:37 -0500 Message-ID: Subject: Re: how does -Wstringop-truncation work? To: Segher Boessenkool Cc: gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.6 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Jan 30, 2023 at 6:12 PM Segher Boessenkool wrote: > > The manual says > The effectiveness of some warnings depends on optimizations also being > enabled. For example '-Wsuggest-final-types' is more effective with > link-time optimization and some instances of other warnings may not be > issued at all unless optimization is enabled. While optimization in > general improves the efficacy of control and data flow sensitive > warnings, in some cases it may also cause false positives. > > > Flags like -O1 do more than just enabling some other flags. > Thank you! Another point of clarification; how is it that -foptimize-strlen is necessary for -Wstringop-truncation to work? Is that noted somewhere?