🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Paul Eggert Thu, 27 Aug 1992 01:39
GCC 2.2.2 sometimes thinks DEL is printable
#1003
Author: Paul Eggert
Date: Thu, 27 Aug 1992 01:39
90 lines
3245 bytes
For the program

	char x = '\^?';

where ^? stands for a single DEL (0177) character,
GCC 2.2.2 (Sparc, SunOS 4.1.2) outputs the error message

	t.c:1: warning: unknown escape sequence `\^?'

where ^? stands for a single DEL character.
GCC should output something like this instead, since DEL isn't printable:

	t.c:1: warning: unknown escape sequence: `\' followed by char code 0x7f

This problem appears in three places in GCC.  Here is a patch.

Thu Aug 27 01:32:11 1992  Paul Eggert  (eggert@twinsun.com)

	* c-lex.c, cp-lex.c (readescape): DEL isn't printable.
	* c-typeck.c (check_format): Likewise.

===================================================================
RCS file: c-lex.c,v
retrieving revision 2.2.2.3
diff -c -r2.2.2.3 c-lex.c
*** c-lex.c	1992/08/27 01:15:00	2.2.2.3
--- c-lex.c	1992/08/27 01:32:11
***************
*** 852,858 ****
  	pedwarn ("non-ANSI escape sequence `\\%c'", c);
        return c;
      }
!   if (c >= 040 && c <= 0177)
      pedwarn ("unknown escape sequence `\\%c'", c);
    else
      pedwarn ("unknown escape sequence: `\\' followed by char code 0x%x", c);
--- 852,858 ----
  	pedwarn ("non-ANSI escape sequence `\\%c'", c);
        return c;
      }
!   if (c >= 040 && c < 0177)
      pedwarn ("unknown escape sequence `\\%c'", c);
    else
      pedwarn ("unknown escape sequence: `\\' followed by char code 0x%x", c);
===================================================================
RCS file: c-typeck.c,v
retrieving revision 2.2.2.5
diff -c -r2.2.2.5 c-typeck.c
*** c-typeck.c	1992/08/12 01:23:10	2.2.2.5
--- c-typeck.c	1992/08/27 01:32:11
***************
*** 1627,1633 ****
  	}
        if (fci->format_chars == 0)
  	{
! 	  if (format_char >= 040 && format_char <= 0177)
  	    sprintf (message,
  		     "unknown conversion type character `%c' in format",
  		     format_char);
--- 1627,1633 ----
  	}
        if (fci->format_chars == 0)
  	{
! 	  if (format_char >= 040 && format_char < 0177)
  	    sprintf (message,
  		     "unknown conversion type character `%c' in format",
  		     format_char);
===================================================================
RCS file: cp-lex.c,v
retrieving revision 2.2.2.2
diff -c -r2.2.2.2 cp-lex.c
*** cp-lex.c	1992/07/24 18:55:24	2.2.2.2
--- cp-lex.c	1992/08/27 01:32:11
***************
*** 2235,2241 ****
      case '[':
        return c;
      }
!   if (c >= 040 && c <= 0177)
      warning ("unknown escape sequence `\\%c'", c);
    else
      warning ("unknown escape sequence: `\\' followed by char code 0x%x", c);
--- 2235,2241 ----
      case '[':
        return c;
      }
!   if (c >= 040 && c < 0177)
      warning ("unknown escape sequence `\\%c'", c);
    else
      warning ("unknown escape sequence: `\\' followed by char code 0x%x", c);
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads