From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 842EE3858D20 for ; Thu, 25 May 2023 05:41:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 842EE3858D20 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-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-51408729f43so1260252a12.0 for ; Wed, 24 May 2023 22:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684993317; x=1687585317; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=lqP8VEiTXhiSmwlNqyK0iwVASOdD6PippGwMX74uYZQ=; b=fWVA6n+jk9tbBtKIQnoLYfa0KYsjOSu2Hg5pEUGUab3SI/c0FIHgA/+zJg+ZIOnbzZ MOeS4IVrt4zEtpihKtOM7Amwa0hPZLkOHOytUVuxCd59seLNKtF5oSGGlrkXvZesPqyv WMJRqgL/pwYnnBKdUNLItUBM9D0HlyamJt33dP7uiNK1iVh1q0aKdAIsmHMlP/2FCnpG 3ls6VNGpGxthGrOrboJf648SpPSxRhfZdS+dzGp+dJCW9gmUKNpILk1xD0DIBB8ppvhO Zg6qSbbSTrRwmPxmME4v6KMIglcFVj63KpgLV1Z+mq3zG/DFBXZKO3R12UDk8yVnqi7v P/IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684993317; x=1687585317; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lqP8VEiTXhiSmwlNqyK0iwVASOdD6PippGwMX74uYZQ=; b=lJEaiH1Dj7COek0Tt+x8DUMJJwK/l3naSxxlDM64uVcS44e2Cuwm+0KBLJ2Oe2UiEx UdvMeo0ox1YYdjw7TP5BdOWO+LWRoBbYaihsOM0pW3hODXVitwnn4lRKquAxMSDG2n2g CWWoQ88+HqrjlllRbfIWD7kDUAzu/CKTg816mWMocpWtDbN2A6KUhvu5yPrFnN2/hPki UTGp7zaWDaMv5LmMzhxLHh+QtIP91UCrZxZYXULUft2+Bkt+CHeCHpq9aO4LmPitqlIW 9cWkfa8tA2vcsfqc6xv90LRlxzb8VvUUTSjrlzxiQeaqlrJcbvdRL5Uz4H8GYAQvgRXq 1h4A== X-Gm-Message-State: AC+VfDxk4j0c12vZQb5bP6cUGmLRteCnqGf+weIk6G7xgvreWD1juBFR /McZjpX+aC2tChIEb22Pxco= X-Google-Smtp-Source: ACHHUZ6Yo0NndDbP/U5vdrPD3rERWUUkOVXCwOcmCux//lxlivDdIzoowp/fjLXhRmJJLlweojGcjQ== X-Received: by 2002:a05:6402:2550:b0:50d:8bc9:41c8 with SMTP id l16-20020a056402255000b0050d8bc941c8mr1515626edb.13.1684993316840; Wed, 24 May 2023 22:41:56 -0700 (PDT) Received: from [127.0.0.1] (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id x2-20020aa7d382000000b00510d6795eddsm172437edq.48.2023.05.24.22.41.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 May 2023 22:41:56 -0700 (PDT) Date: Thu, 25 May 2023 07:41:52 +0200 From: Bernhard Reutner-Fischer To: Qing Zhao CC: Qing Zhao via Gcc-patches , "joseph@codesourcery.com" , "richard.guenther@gmail.com" , "jakub@redhat.com" , "keescook@chromium.org" , "siddhesh@gotplt.org" , "uecker@tugraz.at" Subject: =?US-ASCII?Q?Re=3A_=5BV7=5D=5BPATCH_1/2=5D_Handle_?= =?US-ASCII?Q?component=5Fref_to_a_structre?= =?US-ASCII?Q?/union_field_including_flexible_array_member_=5BPR101832=5D?= In-Reply-To: References: <20230519204948.237791-1-qing.zhao@oracle.com> <20230519204948.237791-2-qing.zhao@oracle.com> <20230520011133.1d813add@nbbrfq.loc> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.4 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 24 May 2023 16:09:21 CEST, Qing Zhao wrote: >Bernhard, > >Thanks a lot for your comments=2E > >> On May 19, 2023, at 7:11 PM, Bernhard Reutner-Fischer wrote: >>=20 >> On Fri, 19 May 2023 20:49:47 +0000 >> Qing Zhao via Gcc-patches wrote: >>=20 >>> GCC extension accepts the case when a struct with a flexible array mem= ber >>> is embedded into another struct or union (possibly recursively)=2E >>=20 >> Do you mean TYPE_TRAILING_FLEXARRAY()? > >The following might be more accurate description: > >GCC extension accepts the case when a struct with a flexible array member > is embedded into another struct or union (possibly recursively) as the l= ast field=2E > > > >>=20 >>> diff --git a/gcc/tree=2Eh b/gcc/tree=2Eh >>> index 0b72663e6a1=2E=2E237644e788e 100644 >>> --- a/gcc/tree=2Eh >>> +++ b/gcc/tree=2Eh >>> @@ -786,7 +786,12 @@ extern void omp_clause_range_check_failed (const_= tree, const char *, int, >>> (=2E=2E=2E) prototype, where arguments can be accessed with va_star= t and >>> va_arg), as opposed to an unprototyped function=2E */ >>> #define TYPE_NO_NAMED_ARGS_STDARG_P(NODE) \ >>> - (TYPE_CHECK (NODE)->type_common=2Eno_named_args_stdarg_p) >>> + (FUNC_OR_METHOD_CHECK (NODE)->type_common=2Eno_named_args_stdarg_p) >>> + >>> +/* True if this RECORD_TYPE or UNION_TYPE includes a flexible array m= ember >>> + at the last field recursively=2E */ >>> +#define TYPE_INCLUDE_FLEXARRAY(NODE) \ >>> + (RECORD_OR_UNION_CHECK (NODE)->type_common=2Eno_named_args_stdarg_p= ) >>=20 >> Until i read the description above i read TYPE_INCLUDE_FLEXARRAY as an >> option to include or not include something=2E The description hints mor= e >> 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=2E > >Yes, TYPE_INCLUDES_FLEXARRAY (maybe with a S is a better name) means the = structure/union TYPE includes a flexible array member or includes a struct = with a flexible array member as the last field=2E > So ANY_TRAILING_FLEXARRAY or TYPE_CONTAINS_FLEXARRAY, TYPE_INCLUDES_FLEXAR= RAY or something like that would be more clear, i don't know=2E I'd probably use the first, but that's enough bike shedding for me now=2E = Let's see what others think=2E thanks, >Hope this is clear=2E >thanks=2E > >Qing >>=20 >>>=20 >>> /* In an IDENTIFIER_NODE, this means that assemble_name was called wit= h >>> this string as an argument=2E */ >>=20 >