This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/5791: '\a' is interpreted as 'a'



>Number:         5791
>Category:       c
>Synopsis:       '\a' is interpreted as 'a'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 28 01:26:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jim Meyering
>Release:        3.2 20020227 (experimental)
>Organization:
>Environment:
System: Linux never 2.4.17 #3 SMP Tue Dec 29 21:27:44 CET 2001 i686 unknown
Architecture: i686

	<machine, os, target, libraries (multiple lines)>
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /mirror/d/gcc/configure --disable-nls --prefix=/p/p/gcc-2002-02-28.01h10
>Description:
'\a' is interpreted as 'a'

>How-To-Repeat:
$ cat k.c
f () { switch (1) { case '\a': case 'a': return; } }
$ gcc k.c
k.c: In function `f':
k.c:1: duplicate case value
k.c:1: previously used here
[Exit 1]

>Fix:
2002-02-28  Jim Meyering  <meyering@lucent.com>

	* cpplex.c (cpp_parse_escape): Restore mistakenly-removed code:
	\a still means TARGET_BELL.

--- cpplex.c.~1.190.~	Thu Feb 28 02:06:24 2002
+++ cpplex.c	Thu Feb 28 10:10:35 2002
@@ -1721,6 +1721,7 @@ cpp_parse_escape (pfile, pstr, limit, ma
     case 'a':
       if (CPP_WTRADITIONAL (pfile))
 	cpp_warning (pfile, "the meaning of '\\a' is different in traditional C");
+      c = TARGET_BELL;
       break;
 
     case 'e': case 'E':
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]