public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Qing Zhao <qing.zhao@oracle.com>
Cc: Joseph Myers <joseph@codesourcery.com>,
	"sandra@codesourcery.com" <sandra@codesourcery.com>,
	Siddhesh Poyarekar <siddhesh@gotplt.org>,
	Kees Cook <keescook@chromium.org>,
	Richard Biener <richard.guenther@gmail.com>,
	gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [V5][PATCH 2/2] Update documentation to clarify a GCC extension
Date: Mon, 27 Mar 2023 17:43:08 +0200	[thread overview]
Message-ID: <ZCG5jFkGgwszzBg9@tucnak> (raw)
In-Reply-To: <D1B5D82F-DCF0-447D-B9C3-A34D2CA9F968@oracle.com>

On Mon, Mar 27, 2023 at 01:38:34PM +0000, Qing Zhao wrote:
> 
> 
> > On Mar 23, 2023, at 4:14 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> > 
> > On Thu, 23 Mar 2023, Qing Zhao via Gcc-patches wrote:
> > 
> >> +Wgnu-variable-sized-type-not-at-end
> >> +C C++ Var(warn_variable_sized_type_not_at_end) Warning
> >> +Warn about structures or unions with C99 flexible array members are not
> >> +at the end of a structure.
> > 
> > I think there's at least one word missing here, e.g. "that" before "are".
> 
> Will fix it.
> > 
> >> +Please use warning option  @option{-Wgnu-variable-sized-type-not-at-end} to
> >> +identify all such cases in the source code and modify them.  This extension
> >> +will be deprecated from gcc in the next release.
> > 
> > We don't generally say "in the next release" in the manual (or "deprecated 
> > from gcc").  Maybe it *is* deprecated, maybe it will be *removed*, or will 
> > *start to warn by default*, in some specified version number (giving a 
> > version number seems better than "next release"), but "will be deprecated" 
> > is odd.
> How about the following:
> 
> +Please use warning option  @option{-Wgnu-variable-sized-type-not-at-end} to

This is certainly misnamed.  GNU variable sized type not at the end of a
struct is something like
void bar (void *);
void foo (int n) {
  struct S { int a; int b[n]; int c; } s;
  s.a = 1;
  __builtin_memset (s.b, 0, sizeof (s.b));
  s.c = 3;
  bar (&s);
}
Certainly not flexible array members in the middle of structure.

> +identify all such cases in the source code and modify them.  This warning will be 
> + on by default starting from GCC14.

	Jakub


  parent reply	other threads:[~2023-03-27 15:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16 21:47 [V5][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size Qing Zhao
2023-03-16 21:47 ` [V5][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832] Qing Zhao
2023-03-23 13:03   ` Fwd: " Qing Zhao
2023-03-23 18:55     ` Joseph Myers
2023-03-27 13:31       ` Qing Zhao
2023-03-27 14:22     ` Qing Zhao
2023-03-16 21:47 ` [V5][PATCH 2/2] Update documentation to clarify a GCC extension Qing Zhao
2023-03-23 13:05   ` Fwd: " Qing Zhao
2023-03-23 20:14     ` Joseph Myers
2023-03-27 13:38       ` Qing Zhao
2023-03-27 14:34         ` Xi Ruoyao
2023-03-27 15:37           ` Qing Zhao
2023-03-27 15:43         ` Jakub Jelinek [this message]
2023-03-27 15:57           ` Qing Zhao
2023-03-27 16:06             ` Jakub Jelinek
2023-03-27 16:22               ` Qing Zhao
2023-03-27 16:31                 ` Jakub Jelinek
2023-03-27 16:48                   ` Qing Zhao
2023-03-27 17:29                     ` Qing Zhao
2023-03-23 13:02 ` Fwd: [V5][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size 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=ZCG5jFkGgwszzBg9@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=keescook@chromium.org \
    --cc=qing.zhao@oracle.com \
    --cc=richard.guenther@gmail.com \
    --cc=sandra@codesourcery.com \
    --cc=siddhesh@gotplt.org \
    /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).