public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/4270: quoted ctrl M breaks parser
@ 2001-09-08 16:11 neil
0 siblings, 0 replies; 3+ messages in thread
From: neil @ 2001-09-08 16:11 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, george, nobody
Synopsis: quoted ctrl M breaks parser
State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Sat Sep 8 16:11:56 2001
State-Changed-Why:
Not a bug - it is treated as a newline as documented.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4270&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c/4270: quoted ctrl M breaks parser
@ 2001-09-08 15:26 Zack Weinberg
0 siblings, 0 replies; 3+ messages in thread
From: Zack Weinberg @ 2001-09-08 15:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* c/4270: quoted ctrl M breaks parser
@ 2001-09-08 14:56 george
0 siblings, 0 replies; 3+ messages in thread
From: george @ 2001-09-08 14:56 UTC (permalink / raw)
To: gcc-gnats
>Number: 4270
>Category: c
>Synopsis: quoted ctrl M breaks parser
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Sep 08 14:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: george@palisad.com
>Release: 3.0.1
>Organization:
>Environment:
solaris x86
>Description:
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.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-09-08 16:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-08 16:11 c/4270: quoted ctrl M breaks parser neil
-- strict thread matches above, loose matches on Subject: below --
2001-09-08 15:26 Zack Weinberg
2001-09-08 14:56 george
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).