This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34203] Treat \ as normal character (at least on Windows); diagnose unrecognized escape characters
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Nov 2007 22:54:01 -0000
- Subject: [Bug fortran/34203] Treat \ as normal character (at least on Windows); diagnose unrecognized escape characters
- References: <bug-34203-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from burnus at gcc dot gnu dot org 2007-11-26 22:54 -------
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'
gfortran should do likewise in match.c's gfc_match_special_char. Actually, we
do not fully support all C escape sequences (see "5.2.2 Character display
semantics", "6.4.4.4 Character constants" and "6.4.3 Universal character
names"); missing are:
- trigraphs (I don't think anyone misses them)
- \" and \' (use "" or '' instead)
- \? (use ?)
- \o, \oo \ooo (o = octal digit) - except of \0
- \xh, \xhh (h = hexadecimal digit)
- \uhhhh, \Uhhhhhhhh (h = hexadecimal digit)
I don't know whether we really need to implement them, but at least we should
document what we have. A proper documentation would be something like Intel's
http://www.intel.com/software/products/compilers/docs/flin/main_for/index.htm
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34203