public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: Qing Zhao via Gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>,
	Qing Zhao <qing.zhao@oracle.com>,
	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]
Date: Sat, 20 May 2023 01:11:33 +0200	[thread overview]
Message-ID: <20230520011133.1d813add@nbbrfq.loc> (raw)
In-Reply-To: <20230519204948.237791-2-qing.zhao@oracle.com>

On Fri, 19 May 2023 20:49:47 +0000
Qing Zhao via Gcc-patches <gcc-patches@gcc.gnu.org> 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.  */


  reply	other threads:[~2023-05-19 23:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19 20:49 [V7][PATCH 0/2]Accept and Handle the case when a structure including a FAM nested in another structure Qing Zhao
2023-05-19 20:49 ` [V7][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832] Qing Zhao
2023-05-19 23:11   ` Bernhard Reutner-Fischer [this message]
2023-05-24 14:09     ` Qing Zhao
2023-05-25  5:41       ` Bernhard Reutner-Fischer
2023-05-25 15:21         ` Qing Zhao
2023-05-19 20:49 ` [V7][PATCH 2/2] Update documentation to clarify a GCC extension [PR77650] Qing Zhao
2023-05-19 21:12   ` Joseph Myers
2023-05-24 13:05     ` Qing Zhao
2023-05-24 16:57     ` Qing Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230520011133.1d813add@nbbrfq.loc \
    --to=rep.dot.nop@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=keescook@chromium.org \
    --cc=qing.zhao@oracle.com \
    --cc=richard.guenther@gmail.com \
    --cc=siddhesh@gotplt.org \
    --cc=uecker@tugraz.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).