home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / gcc / bug / 3133 < prev    next >
Encoding:
Text File  |  1993-01-08  |  4.3 KB  |  134 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!uproar.enet.DEc.COM!murnaghant
  3. From: murnaghant@uproar.enet.DEc.COM (07-Jan-1993 1501)
  4. Subject: cpp line directives
  5. Message-ID: <9301071500.AA26300@enet-gw.pa.dec.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Thu, 7 Jan 1993 15:00:32 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 121
  12.  
  13.                   I N T E R O F F I C E   M E M O R A N D U M
  14.  
  15.                                         Date:     07-Jan-1993 02:57pm BST
  16.                                         From:     Tim Murnaghan @IME
  17.                                                   MURNAGHANT
  18.                                         Dept:     
  19.                                         Tel No:   
  20.  
  21. TO:  Remote Addressee                     ( _DECWRL::"BUG-GCC@PREP.AI.MIT.EDU" )
  22.  
  23.  
  24. Subject: cpp line directives
  25.  
  26. A small bug report and a minor usability enhancement.
  27.  
  28. We find it useful to have a portable ansi pre-processor for other things as
  29. well as C (like for pre-processing Makefiles - as imake does).
  30.  
  31. "gcc -E -" does not currently work as the suffix length check in gcc is before
  32. the check for "-".
  33.  
  34. Programs like imake expect the # line number directives to be of a standard
  35. form and so complains about the GNU cc1 specific 1,2,3 bits on the end of them.
  36.  
  37. The attached patch adds a -L flag to the pre-processor to turn these off, and
  38. gcc uses this flag when used with "-E -".
  39.  
  40. *** gcc.c.orig    Thu Jan  7 14:03:12 1993
  41. --- gcc.c    Thu Jan  7 14:42:57 1993
  42. ***************
  43. *** 450,455 ****
  44. --- 450,456 ----
  45.                         %{!pipe:%g.s} %A\n }}}}"},
  46.     {"-",
  47.      "%{E:cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
  48. +     %{E:-L}\
  49.       %{C:%{!E:%eGNU C does not support -C without using -E}}\
  50.       %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
  51.           -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
  52. ***************
  53. *** 3589,3595 ****
  54.     /* Look for a suffix.  */
  55.     for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
  56.       {
  57. !       if (strlen (cp->suffix) < length
  58.              /* See if the suffix matches the end of NAME.  */
  59.              && !strcmp (cp->suffix,
  60.                  name + length - strlen (cp->suffix))
  61. --- 3590,3596 ----
  62.     /* Look for a suffix.  */
  63.     for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
  64.       {
  65. !       if ((strlen (cp->suffix) < length || !strcmp(cp->suffix, "-"))
  66.              /* See if the suffix matches the end of NAME.  */
  67.              && !strcmp (cp->suffix,
  68.                  name + length - strlen (cp->suffix))
  69. *** cccp.c.orig    Thu Jan  7 14:05:25 1993
  70. --- cccp.c    Thu Jan  7 14:05:56 1993
  71. ***************
  72. *** 363,368 ****
  73. --- 363,369 ----
  74.   /* Nonzero means don't output line number information.  */
  75.   
  76.   static int no_line_commands;
  77. + static int normal_line_commands;
  78.   
  79.   /* dump_only means inhibit output of the preprocessed text
  80.                and instead output the definitions of all user-defined
  81. ***************
  82. *** 1002,1007 ****
  83. --- 1003,1009 ----
  84.     dollars_in_ident = DOLLARS_IN_IDENTIFIERS > 0;
  85.   
  86.     no_line_commands = 0;
  87. +   normal_line_commands = 0;
  88.     no_trigraphs = 1;
  89.     dump_macros = dump_none;
  90.     no_output = 0;
  91. ***************
  92. *** 1283,1288 ****
  93. --- 1285,1294 ----
  94.       no_line_commands = 1;
  95.       break;
  96.   
  97. +       case 'L':
  98. +     normal_line_commands = 1;
  99. +     break;
  100.         case '$':            /* Don't include $ in identifiers.  */
  101.       dollars_in_ident = 0;
  102.       break;
  103. ***************
  104. *** 6822,6832 ****
  105.   #else
  106.     sprintf (line_cmd_buf, "# %d \"%s\"", ip->lineno, ip->nominal_fname);
  107.   #endif
  108. !   if (file_change != same_file)
  109. !     strcat (line_cmd_buf, file_change == enter_file ? " 1" : " 2");
  110. !   /* Tell cc1 if following text comes from a system header file.  */
  111. !   if (ip->system_header_p)
  112. !     strcat (line_cmd_buf, " 3");
  113.     len = strlen (line_cmd_buf);
  114.     line_cmd_buf[len++] = '\n';
  115.     check_expand (op, len + 1);
  116. --- 6828,6840 ----
  117.   #else
  118.     sprintf (line_cmd_buf, "# %d \"%s\"", ip->lineno, ip->nominal_fname);
  119.   #endif
  120. !   if (normal_line_commands == 0) {
  121. !     if (file_change != same_file)
  122. !       strcat (line_cmd_buf, file_change == enter_file ? " 1" : " 2");
  123. !     /* Tell cc1 if following text comes from a system header file.  */
  124. !     if (ip->system_header_p)
  125. !       strcat (line_cmd_buf, " 3");
  126. !   }
  127.     len = strlen (line_cmd_buf);
  128.     line_cmd_buf[len++] = '\n';
  129.     check_expand (op, len + 1);
  130.  
  131.  
  132.  
  133.