public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "simon_baldwin at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/23688] New: Compiler does not warn on selected unknown character escapes
Date: Thu, 01 Sep 2005 23:05:00 -0000	[thread overview]
Message-ID: <20050901230506.23688.simon_baldwin@yahoo.com> (raw)

Given the following short test program:

  const char *s1 = "\%\(\[\{"; // all these are invalid escape sequences
  const char *s2 = "\)\]\}";   // so are these

the compiler warns about the unknown escape sequences in s2 (and everything else
you can come up with), but ignores the particular sequences in s1, even though
they're just as invalid.

>From section 2.13.2, paragraph 3, of the 1998 C++ Standard:

Certain nongraphic characters, the single quote ', the double quote ", the
question mark ?, and the back-slash \, can be represented according to Table 5.
 ... If the character following a backslash is not one of those specified, the
behavior is undefined.

A warning for these four renegade unknown escapes, then, would be useful.

-- 
           Summary: Compiler does not warn on selected unknown character
                    escapes
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: simon_baldwin at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


             reply	other threads:[~2005-09-01 23:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-01 23:05 simon_baldwin at yahoo dot com [this message]
2005-09-01 23:11 ` [Bug preprocessor/23688] " pinskia at gcc dot gnu dot org
2005-09-01 23:16 ` pinskia at gcc dot gnu dot 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=20050901230506.23688.simon_baldwin@yahoo.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).