public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "algrant at acm dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/39383] sizeof object with zero-length array ignores initializer
Date: Thu, 05 Mar 2009 13:19:00 -0000	[thread overview]
Message-ID: <20090305131905.3466.qmail@sourceware.org> (raw)
In-Reply-To: <bug-39383-1535@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from algrant at acm dot org  2009-03-05 13:19 -------
No, the case is an extension to C.  6.5.3.4 was obviously written without
this case in mind.  In this case "the size... of its operand" cannot be
"determined from the type".  Either sizeof doesn't return the (real) size
of the operand, or it isn't determined from the type.  Current GCC behavior
is to have it not return the size of the operand.  That's a valid point of 
view but it does mean one needs to take care when using sizeof on such
objects, and it's worth documenting.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39383


  parent reply	other threads:[~2009-03-05 13:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05 12:39 [Bug c/39383] New: " algrant at acm dot org
2009-03-05 13:06 ` [Bug c/39383] " ebotcazou at gcc dot gnu dot org
2009-03-05 13:19 ` algrant at acm dot org [this message]
2009-03-05 13:31 ` ebotcazou at gcc dot gnu dot org
2009-03-05 13:53 ` joseph at codesourcery dot com
2009-03-05 14:48 ` algrant at acm dot org
2009-03-06 14:45 ` algrant at acm dot org
2009-03-06 17:27 ` jsm28 at gcc dot gnu dot org
2009-04-08 21:36 ` b07584 at freescale dot com
2009-04-08 22:54 ` joseph at codesourcery dot com
2009-04-17 22:39 ` anmol at freescale dot com
2009-04-23 15:53 ` anmol at freescale dot com

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=20090305131905.3466.qmail@sourceware.org \
    --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).