From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id AF1F93858C41 for ; Fri, 19 May 2023 23:11:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF1F93858C41 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-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f41dceb9caso9702955e9.0 for ; Fri, 19 May 2023 16:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684537898; x=1687129898; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ZF15MycYzrcmJ1rwbaMtn8JiWRv2ZSSJVOrdKkYSkkM=; b=KO0WrqmAdD2HKijCCWOVvDaZcNMfMSTKgv906FrhOlnqA+4ZW59evqE65+h6dH/n5E 3peTaz8PLLmLn2lGZS6ItunbSA5iJOogONLK4rEKjNhHqhaqU2rElHre2cDCPEozxe9g SDaLuIwK7Wt11VTxKhZx5vmXYE5gd6xAuA3HcDIubeuRDhZFMilwTaSDrQlZjQZO/kXj kmzUst+laatNVvms7FVrPnektnMuJRuv6lL6iG/YJsL+X4XJ6OhylDA8z2c66KOytOfg YK1zib+AKm1PHv/Obg328jM3zUS+c2rMn8z+LROavTSHSDQvr5HoGV+pQtRFY9E1RaJ3 +6kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684537898; x=1687129898; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZF15MycYzrcmJ1rwbaMtn8JiWRv2ZSSJVOrdKkYSkkM=; b=lGU9blGFxmGIOxpEEiQxj5piuB9qtkCb0PcVjjgdW8PHr3RI+qMnpOAcvWK6imB4v4 ZNkSMmwTrkNHLAvRRifDcEcl0cQUaZ+gMM+gRJOjPGLjy9yUBpqhww30gCY4IV0qegZu ZfLYqNCe37PnVo6ZWd0I+OMnFhnMiaPoj7dTrqZBgn/0IvGgKUkZ0jr29LvRN7VS07FP Li+XU+tDC4hpWNX3UAGxEbltR9zbLatrdjlu1SH7+l9cLU9pk4h4HxivDZ0h9X5hGwAe CIAlt3eJDhNaijstzqVLumzpCN0CtkhEnkRmQVRGfQjPX4o4RY3KZUDW4j7qCDqPjpCf iuOA== X-Gm-Message-State: AC+VfDwNrIAVRUdNbJb3ZhEckLZvNQ4KXy8jCRn55Vxsc0KgaHhiZvFc 80VWf/z7EnwYvkFQw6oVkV8= X-Google-Smtp-Source: ACHHUZ6DEYAdDWM3TlgEzQomk9kwYJpwlPv9K9+brZWCj44lqtqo++plE9WiIzWvyzcRvjkXScox4A== X-Received: by 2002:a7b:c8d9:0:b0:3f4:1ce0:a606 with SMTP id f25-20020a7bc8d9000000b003f41ce0a606mr2407225wml.1.1684537898117; Fri, 19 May 2023 16:11:38 -0700 (PDT) Received: from nbbrfq.loc (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id n4-20020a1c7204000000b003f4f9274d10sm477067wmc.16.2023.05.19.16.11.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 16:11:37 -0700 (PDT) Date: Sat, 20 May 2023 01:11:33 +0200 From: Bernhard Reutner-Fischer To: Qing Zhao via Gcc-patches Cc: Bernhard Reutner-Fischer , Qing Zhao , joseph@codesourcery.com, richard.guenther@gmail.com, jakub@redhat.com, keescook@chromium.org, siddhesh@gotplt.org, uecker@tugraz.at Subject: Re: [V7][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832] Message-ID: <20230520011133.1d813add@nbbrfq.loc> In-Reply-To: <20230519204948.237791-2-qing.zhao@oracle.com> References: <20230519204948.237791-1-qing.zhao@oracle.com> <20230519204948.237791-2-qing.zhao@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 Fri, 19 May 2023 20:49:47 +0000 Qing Zhao via Gcc-patches wrote: > GCC extension accepts the case when a struct with a flexible array member > is embedded into another struct or union (possibly recursively). Do you mean TYPE_TRAILING_FLEXARRAY()? > diff --git a/gcc/tree.h b/gcc/tree.h > index 0b72663e6a1..237644e788e 100644 > --- a/gcc/tree.h > +++ b/gcc/tree.h > @@ -786,7 +786,12 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, > (...) prototype, where arguments can be accessed with va_start and > va_arg), as opposed to an unprototyped function. */ > #define TYPE_NO_NAMED_ARGS_STDARG_P(NODE) \ > - (TYPE_CHECK (NODE)->type_common.no_named_args_stdarg_p) > + (FUNC_OR_METHOD_CHECK (NODE)->type_common.no_named_args_stdarg_p) > + > +/* True if this RECORD_TYPE or UNION_TYPE includes a flexible array member > + at the last field recursively. */ > +#define TYPE_INCLUDE_FLEXARRAY(NODE) \ > + (RECORD_OR_UNION_CHECK (NODE)->type_common.no_named_args_stdarg_p) Until i read the description above i read TYPE_INCLUDE_FLEXARRAY as an option to include or not include something. The description hints more at TYPE_INCLUDES_FLEXARRAY (with an S) to be a type which has at least one member which has a trailing flexible array or which itself has a trailing flexible array. > > /* In an IDENTIFIER_NODE, this means that assemble_name was called with > this string as an argument. */