------- Comment #9 from kargl at gcc dot gnu dot org 2007-11-26 23:21 ------- (In reply to comment #8) > I just committed Steve's patch. Now gfortran uses -fno-backslash by default. > > Now we only need to improve the warning: > > For C gcc warns for: > > char c[] = "\w"; > > a.c:3:14: warning: unknown escape sequence '\w' >
Tobias, I think that gfortran should not bother with a warning. A better solution would be to simply list the escape sequences that -fbackslash trigger, and state the all other combinations are not expanded. I think gfortran definitely wants to avoid the pandora's box of trigraph, octal, and hexidecimal escaped character sequences. The following was tested with a "make pdf" Index: invoke.texi =================================================================== --- invoke.texi (revision 130454) +++ invoke.texi (working copy) @@ -239,6 +239,11 @@ Allow @samp{$} as a valid character in a @cindex escape characters Change the interpretation of backslashes in string literals from a single backslash character to ``C-style'' escape characters. +The following combinations are expanded \a, \b, \f, \n, \r, \t, +\v, \\, and \0 to the ASCII characters alert, backspace, form feed, +newline, carriage return, horizontal tab, vertical tab, backslash, +and NUL, respectively. All other combinations of a character preceded +by \ are unexpanded. @item -fmodule-private @opindex @code{fmodule-private} -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34203