public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "trav at mac 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: Thu, 20 May 2004 20:23:00 -0000 [thread overview]
Message-ID: <20040519214417.31044.qmail@sourceware.org> (raw)
In-Reply-To: <20040128132357.13896.rhajdaj@yahoo.com>
------- Additional Comments From trav at mac dot com 2004-05-19 21:44 -------
(In reply to comment #10)
> You're right. This compiler works in agreement with the requirement, so I
> should stop bugging you guys. I guess I'm just not seeing the "why" behind the
> requirement. When in is it a perfectly acceptable condition (ie according to -
> Wall) not to null-terminate a literal string in an array like this? (I don't
> understand the "if there's room" part of the requirement.) And who do I talk
> to to challenge requirements so I can leave you alone?
>
Here is the rationale:
Since it is an array of characters, you should be able to use a convenient initializer to specify every
element of the array, including the last. Thus, you are allowed to use a double-quoted string, and no
null-character will be stored.
Not that I agree with making it so easy to create a unterminated string...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13896
prev parent reply other threads:[~2004-05-19 21:44 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
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 [this message]
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=20040519214417.31044.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).