Re: Unrecognized escape sequences in string literals



On Aug 11, 2:00 pm, Steven D'Aprano <st...@REMOVE-THIS-
cybersource.com.au> wrote:

test.cpp:1:1: warning: unknown escape sequence '\y'

Isn't that a warning, not a fatal error? So what does temp contain?

My "Annotated C++ Reference Manual" is packed, and surprisingly in
Stroustrup's Third Edition, there is no mention of the issue in the
entire 1,000 pages. But Microsoft to the rescue:

If you want a backslash character to appear within a string,
you must type two backslashes (\\)

(From http://msdn.microsoft.com/en-us/library/69ze775t.aspx)

The question of what any specific C++ does if you ignore the warning
is irrelevant, as such behavior in C++ is almost *always* undefined.
Hence the warning.

|>ouglas
.



Relevant Pages

  • Re: warning: no newline at end of file
    ... >What is the significance of this warning: ... immediately preceded by a backslash character before any such splicing ... independence among source files of a translation unit, by requiring ... each included source file be composed of a sequence of complete lines. ...
    (comp.lang.c)
  • Re: Asus Mobo & Probe II
    ... CPU microcode updates, are pushed forward via updated bios revisions. ... I had hoped I might find a post regarding any problems with Probe II. ... immediately get the Probe warning that the CPU has passed the threshold ... set temp 60c - sometimes it reaches 67c. ...
    (microsoft.public.windowsxp.hardware)
  • Re: regarding free
    ... char * process ... //code for copying the data to temp which are only in odd places. ... foo.c:4: warning: implicit declaration of function `malloc' ... foo.c:6: warning: implicit declaration of function `process' ...
    (comp.lang.c)
  • Re: Asus Mobo & Probe II
    ... no idea if the readings I am getting are true or false. ... immediately get the Probe warning that the CPU has passed the threshold ... set temp 60c - sometimes it reaches 67c. ... longer getting good contact with the CPU. ...
    (microsoft.public.windowsxp.hardware)
  • Re: Asus Mobo & Probe II
    ... Assuming the cooling system *is* working properly... ... get the Probe warning that the CPU has passed the threshold set temp 60c - ...
    (microsoft.public.windowsxp.hardware)