public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Zack Weinberg <zack@codesourcery.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org
Subject: Re: c/4270: quoted ctrl M breaks parser
Date: Sat, 08 Sep 2001 15:26:00 -0000	[thread overview]
Message-ID: <20010908222603.5895.qmail@sourceware.cygnus.com> (raw)

The following reply was made to PR c/4270; it has been noted by GNATS.

From: Zack Weinberg <zack@codesourcery.com>
To: george@palisad.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/4270: quoted ctrl M breaks parser
Date: Sat, 8 Sep 2001 15:21:48 -0700

 On Sat, Sep 08, 2001 at 09:46:26PM -0000, george@palisad.com wrote:
 > When a '^M' occurs as a character, i.e.
 > 
 > 	*c == '^M'
 > 
 > the parser breaks.  The string ^M represents an
 > octal 015 character and was inserted from emacs
 > by quoting a ctrl M.
 
 I am going to assume that "the parser breaks" means that you see the
 compiler issue a series of syntax errors on this code, because that's
 what I get for similar code:
 
 test.c:1:10: missing terminating ' character
 test.c:1: empty character constant
 test.c:2:1: missing terminating ' character
 test.c:2: parse error before ';'
 
 In the future please be more precise about what the compiler did and
 what you think it should have done instead.
 
 The character with the octal value 015 in ASCII is CARRIAGE RETURN.
 Some computer systems use this character to indicate the end of a
 line.  To maximize interoperability, GCC recognizes CARRIAGE RETURN as
 the end of a line no matter what system it has been built for.
 
 If you want octal 015 as a character constant, write '\015'.  If you
 want CARRIAGE RETURN, which is not necessarily octal 015 in all
 encodings, write '\r'.
 
 There is no way to write "the character generated by the operating
 system when the user types control-M" in ISO C, but libraries such as
 ncurses offer this information.
 
 zw


             reply	other threads:[~2001-09-08 15:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-08 15:26 Zack Weinberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-09-08 16:11 neil
2001-09-08 14:56 george

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=20010908222603.5895.qmail@sourceware.cygnus.com \
    --to=zack@codesourcery.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@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).