public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kees at outflux dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/101836] __builtin_object_size(P->M, 1) where M is an array and the last member of a struct fails
Date: Wed, 06 Jul 2022 16:49:46 +0000	[thread overview]
Message-ID: <bug-101836-4-8oQCZw7ws9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101836-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836

--- Comment #34 from Kees Cook <kees at outflux dot net> ---
-fstrict-flex-arrays=3 is still needed. (E.g. for proper FORTIFY coverage,
etc.) I don't have an opinion about the -W options, though.(In reply to James Y
Knight from comment #33)
> (In reply to qinzhao from comment #32)
> > there is a Bugzilla that has been filed for GCC to request the same warning
> > for GCC:
> > https://gcc.gnu.org/bugzilla//show_bug.cgi?id=94428
> > 
> > -Wzero-length-array
> 
> Great. Adding that flag, and eliminating the -fstrict-flex-arrays=3 option
> from this proposal would be good.

Hmm? No, -fstrict-flex-arrays=3 is still needed (because it changes compiler
_behavior_, e.g. for proper FORTIFY coverage or trailing arrays, etc).

I don't have a strong opinion about the -W options; but they can't warn if they
just see a struct declaration with a 0 or 1 element array: userspace will have
those for years to come. Maybe it would warn if such a struct member is ever
actually used in the code? That kind of behavior would be useful for the Linux
kernel at least.

  parent reply	other threads:[~2022-07-06 16:49 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09 23:25 [Bug c/101836] New: " kees at outflux dot net
2021-08-09 23:34 ` [Bug c/101836] " pinskia at gcc dot gnu.org
2021-08-09 23:35 ` pinskia at gcc dot gnu.org
2021-08-10  1:19 ` kees at outflux dot net
2021-10-13  2:11 ` msebor at gcc dot gnu.org
2021-10-13  2:11 ` [Bug middle-end/101836] " msebor at gcc dot gnu.org
2021-10-13  3:11 ` siddhesh at gotplt dot org
2022-05-26 16:34 ` qinzhao at gcc dot gnu.org
2022-05-27  1:45 ` siddhesh at gcc dot gnu.org
2022-05-27 14:27 ` qinzhao at gcc dot gnu.org
2022-05-27 21:01 ` kees at outflux dot net
2022-05-27 21:08 ` kees at outflux dot net
2022-05-27 21:15 ` kees at outflux dot net
2022-06-08 14:09 ` qinzhao at gcc dot gnu.org
2022-06-08 15:37 ` kees at outflux dot net
2022-06-08 16:06 ` qinzhao at gcc dot gnu.org
2022-06-10 20:15 ` qinzhao at gcc dot gnu.org
2022-06-10 20:24 ` qinzhao at gcc dot gnu.org
2022-06-11  8:21 ` kees at outflux dot net
2022-06-13 14:48 ` msebor at gcc dot gnu.org
2022-06-13 18:12 ` kees at outflux dot net
2022-06-13 22:27 ` msebor at gcc dot gnu.org
2022-06-14  0:00 ` kees at outflux dot net
2022-06-14  5:09 ` siddhesh at gcc dot gnu.org
2022-06-14  5:21 ` siddhesh at gcc dot gnu.org
2022-06-14  7:25 ` jakub at gcc dot gnu.org
2022-06-14 15:00 ` qinzhao at gcc dot gnu.org
2022-06-14 15:39 ` siddhesh at gcc dot gnu.org
2022-06-14 16:02 ` qing.zhao at oracle dot com
2022-06-14 16:17 ` jakub at gcc dot gnu.org
2022-06-14 21:03 ` qinzhao at gcc dot gnu.org
2022-06-14 21:12 ` jakub at gcc dot gnu.org
2022-06-25  0:52 ` foom at fuhm dot net
2022-06-27 14:01 ` qinzhao at gcc dot gnu.org
2022-07-06 16:16 ` foom at fuhm dot net
2022-07-06 16:49 ` kees at outflux dot net [this message]
2022-07-06 17:53 ` qinzhao at gcc dot gnu.org
2022-07-06 19:30 ` foom at fuhm dot net
2022-07-06 19:46 ` foom at fuhm dot net
2022-07-06 20:01 ` qinzhao at gcc dot gnu.org
2022-07-06 20:05 ` qinzhao at gcc dot gnu.org
2022-07-22 22:33 ` isanbard at gmail dot com
2022-07-23  1:57 ` kees at outflux dot net
2022-10-07 17:44 ` cvs-commit at gcc dot gnu.org
2022-12-21 20:47 ` qinzhao at gcc dot gnu.org
2023-06-21 19:47 ` qinzhao at gcc dot gnu.org

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=bug-101836-4-8oQCZw7ws9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).