From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id 59F9C3857C51 for ; Fri, 18 Nov 2022 16:31:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 59F9C3857C51 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pj1-x1034.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso5223013pjt.0 for ; Fri, 18 Nov 2022 08:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=PVmcVp0tlAaPaPuOVDuEj4cBKfAZScsNwxmF3Pko7JA=; b=dgkxTazhtwIUjKVqvutQRdWNYhlQs8ZDJyiXaAlO3nbDRLO+hFSfUwkYbyUG132afS lYEYietwekm8OkdIbt9wG8511fdw5B/ySK10NRg0OOxhnKpx4Xyt+tryvZLBeb0HkLNy sMTrzjl9DwtJ5Taa8soVMA13usCkgPgwp3Vxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PVmcVp0tlAaPaPuOVDuEj4cBKfAZScsNwxmF3Pko7JA=; b=ATke5KwO9dMG1nBLX+YVejC0AE7oA5eh3fnES6r7kWERetg+T74bSj5xk0Jmtei3Fb z3bN3tO0sqf3kEuwm5EdkS71pUSRKEVgX9dplnMrS4cYqdBrz7Qxw1xeJlod23/A0ERK zBQEaX/MuKZBQDDb3MYkOIcRGGGf/m3wcZplTn77XKgDA7ZZsPiNakTJWDFhHe+8MqST cVi4KVHJ8ZA4MKsurPmSizaNy7YsuLcH0gVRjbpjTe+WUmNLvW/jLrglyVL8bt+vhl9o uJCF/8mOT06n6msXb7zkNS2JTDE+hpgGiAQ03Inz3wveRjCoIWDo+aSt8MoPE7s7xzcX qvJg== X-Gm-Message-State: ANoB5pmb9zl5C0ZyVZ7Im3ze8EGe/h+jWNhl+lm0Q07NqG+9VU1uCA+V 3txuT6DNSq73BNPXB4Rl2snXyw== X-Google-Smtp-Source: AA0mqf7Y24eHmIsKSnhzwfxbN4hR+fXl6S1feJmyavcjcsbDUIs4kSaHiMzN4ZIsaXx/CgVJAtn1yg== X-Received: by 2002:a17:902:f68a:b0:186:f256:91cd with SMTP id l10-20020a170902f68a00b00186f25691cdmr165255plg.152.1668789107772; Fri, 18 Nov 2022 08:31:47 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id x1-20020a628601000000b005289a50e4c2sm3384500pfd.23.2022.11.18.08.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 08:31:47 -0800 (PST) Date: Fri, 18 Nov 2022 08:31:46 -0800 From: Kees Cook To: Qing Zhao Cc: Richard Biener , "joseph@codesourcery.com" , gcc Patches , "siddhesh@gcc.gnu.org" Subject: Re: [PATCH 2/2] Add a new warning option -Wstrict-flex-arrays. Message-ID: <202211180829.4F995ED2@keescook> References: <20221108145113.955321-1-qing.zhao@oracle.com> <20221108145113.955321-3-qing.zhao@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 Fri, Nov 18, 2022 at 03:19:07PM +0000, Qing Zhao wrote: > Hi, Richard, > > Honestly, it’s very hard for me to decide what’s the best way to handle the interaction > between -fstrict-flex-array=M and -Warray-bounds=N. > > Ideally, -fstrict-flex-array=M should completely control the behavior of -Warray-bounds. > If possible, I prefer this solution. > > However, -Warray-bounds is included in -Wall, and has been used extensively for a long time. > It’s not safe to change its default behavior. I prefer that -fstrict-flex-arrays controls -Warray-bounds. That it is in -Wall is _good_ for this reason. :) No one is going to add -fstrict-flex-arrays (at any level) without understanding what it does and wanting those effects on -Warray-bounds. -- Kees Cook