home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / gnu / gcc / bug / 2635 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.3 KB  |  51 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!twinsun.COM!eggert
  3. From: eggert@twinsun.COM (Paul Eggert)
  4. Subject: cpp doesn't diagnose '\^X' (GCC 2.3.1)
  5. Message-ID: <9211060138.AA03142@farside.twinsun.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Fri, 6 Nov 1992 01:38:10 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 38
  12.  
  13. GCC 2.3.1 (sparc, SunOS 4.1.2) does not diagnose the syntax error in the first
  14. line of the following program:
  15.  
  16.     #if '\^X'
  17.     main() { return 0; }
  18.     #endif
  19.  
  20. cc1 rejects '\^X', so the simplest fix is to have cpp reject it too:
  21.  
  22.  
  23. Fri Nov  6 01:29:53 1992  Paul Eggert  (eggert@twinsun.com)
  24.  
  25.     * cexp.y (parse_escape): Don't accept '\^X'.
  26.  
  27. ===================================================================
  28. RCS file: cexp.y,v
  29. retrieving revision 2.3
  30. retrieving revision 2.3.1.1
  31. diff -c -r2.3 -r2.3.1.1
  32. *** cexp.y    1992/10/21 06:53:52    2.3
  33. --- cexp.y    1992/11/06 01:29:53    2.3.1.1
  34. ***************
  35. *** 764,776 ****
  36.       case 0:
  37.         (*string_ptr)--;
  38.         return 0;
  39. -     case '^':
  40. -       c = *(*string_ptr)++;
  41. -       if (c == '\\')
  42. -     c = parse_escape (string_ptr);
  43. -       if (c == '?')
  44. -     return 0177;
  45. -       return (c & 0200) | (c & 037);
  46.         
  47.       case '0':
  48.       case '1':
  49. --- 764,769 ----
  50.  
  51.