public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rhajdaj at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/13896] Initializer string warning not printed if implied NULL-terminator out of bounds
Date: Wed, 28 Jan 2004 16:52:00 -0000	[thread overview]
Message-ID: <20040128165158.16186.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040128132357.13896.rhajdaj@yahoo.com>


------- Additional Comments From rhajdaj at yahoo dot com  2004-01-28 16:51 -------
I suppose it's blasphemy to disagree with that requirement, but since '\0' is 
indeed an element of any array containing it (implicitly or otherwise), it's my 
opinion that the requirement (though it might satisfy the letter of some law), 
disagrees with descriptions of string literals like (K & R p. 38):

"The internal representation of a string has a null character '\0' at the end, 
so the physical storage required is one more than the number of characters 
written between the quotes."

So a[0][] (using the a[][3] = {{"Hel"}, {"Hi"}} example) must take up 4 bytes.  
Given the requirement, you're right.  I got nothin.  But the requirement seems 
bogus to me.



-- 


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


  parent reply	other threads:[~2004-01-28 16:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-28 13:23 [Bug c/13896] New: " rhajdaj at yahoo dot com
2004-01-28 13:58 ` [Bug c/13896] " schwab at suse dot de
2004-01-28 14:20 ` bangerth at dealii dot org
2004-01-28 14:42 ` schwab at suse dot de
2004-01-28 14:47 ` bangerth at dealii dot org
2004-01-28 15:26 ` schwab at suse dot de
2004-01-28 15:52 ` bangerth at dealii dot org
2004-01-28 16:37 ` pinskia at gcc dot gnu dot org
2004-01-28 16:52 ` rhajdaj at yahoo dot com [this message]
2004-01-28 16:56 ` pinskia at gcc dot gnu dot org
2004-01-28 17:35 ` schwab at suse dot de
2004-01-28 18:13 ` rhajdaj at yahoo dot com
2004-01-29  1:17 ` pinskia at gcc dot gnu dot org
2004-01-29 11:23 ` rhajdaj at yahoo dot com
2004-05-20 20:23 ` trav at mac 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=20040128165158.16186.qmail@sources.redhat.com \
    --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).