public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* warning: unknown escape sequence '\)'
@ 2002-02-05  3:07 kabir.patel
  0 siblings, 0 replies; 2+ messages in thread
From: kabir.patel @ 2002-02-05  3:07 UTC (permalink / raw)
  To: me; +Cc: fwyzard, gcc-help




I used to have a piece of c code that compiled fine. I now get the follwing
error message with the GNU compiler:

 warning: unknown escape sequence '\)'

The line that it references is:

 fprintf(stream_FND_Resevoir_ctl, "\)\n");

I do not fully understand this (I didn't write the code).

Can somebody tell me:
a) What "\)\n" means?
b) Why it isn't compiling now?
b) If it can be validly replaced?

Thanks in advance


*******************Internet Email Confidentiality Footer*******************


Privileged/Confidential Information may be contained in this message.  If you
are not the addressee indicated in this message (or responsible for delivery of
the message to such person), you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender by
reply email. Please advise immediately if you or your employer does not consent
to Internet email for messages of this kind.  Opinions, conclusions and other
information in this message that do not relate to the official business of my
firm shall be understood as neither given nor endorsed by it.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: warning: unknown escape sequence '\)'
       [not found] <616BE6A276E3714788D2AC35C40CD18D394BDC@whale.softwire.co.uk>
@ 2002-02-05  3:25 ` Rupert Wood
  0 siblings, 0 replies; 2+ messages in thread
From: Rupert Wood @ 2002-02-05  3:25 UTC (permalink / raw)
  To: kabir.patel; +Cc: gcc-help

Kabir Patel wrote:

>  warning: unknown escape sequence '\)'

Backslash is used as an escaping character for C strings; if you'd like
to include a character that you wouldn't normally be able to represent
in a text file then you can use an escape code for it, for example:

    \t    tab (ASCII 9)
    \n    newline (ASCII 10)
    \r    carriage return (ASCII 13)
    \001  character with octal value 001
    \xAB  character with hexadecimal value AB

but since backslash has been overloaded, an escape is necessary to
actually embed a backslash:

    \\    backslash

Now there is no '\)' escape defined in C; however, ')' can be escaped in
sed/perl/etc. regular expressions to change its meaning. By default (I
think), an unrecognised escape code will just emit the escaped character
without the escaping backslash, i.e. this will be treated as ')' here.

> a) What "\)\n" means?

Presumably it means a short string: right close bracket, end of line (+
string terminating nul).

> b) Why it isn't compiling now?

It is. That was just a warning; unless you've also specified -Werror
(treat warnings as errors) then this won't stop compilation.

> b) If it can be validly replaced?

Yes, ")\n" is probably correct.

Rup.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-02-05 11:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-05  3:07 warning: unknown escape sequence '\)' kabir.patel
     [not found] <616BE6A276E3714788D2AC35C40CD18D394BDC@whale.softwire.co.uk>
2002-02-05  3:25 ` Rupert Wood

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).