This is the mail archive of the gcc-bugs@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]

egcs-980315 bug report



Hello there,

As part of getting the pre processor for G++ to emit something it
can later eat, I found the following set of diffs for egcs-980315
useful.

Note I've upgraded some of the warnings to errors as well.
I'm interested in compiling ISO C++, not compatability with
broken code.

I've also ensured that when the pre processor finds an error,
it prints out a unique string. This makes grepping thru compile
output much easier. Something similar can be done with toplev.c
as well.

./gcc/cccp.c
*** ./gcc/cccp.c	Thu Mar 12 14:49:30 1998
--- ../egcs-980315.dcb/./gcc/cccp.c	Mon Mar 16 19:17:18 1998
***************
*** 7446,7452 ****
    if (pedantic) {
      SKIP_WHITE_SPACE (buf);
      if (buf != limit)
!       pedwarn ("text following `#else' violates ANSI standard");
    }

    if (if_stack == instack[indepth].if_stack) {
--- 7446,7452 ----
    if (pedantic) {
      SKIP_WHITE_SPACE (buf);
      if (buf != limit)
!       error("text following `#else' violates ANSI standard");
    }

    if (if_stack == instack[indepth].if_stack) {
***************
*** 7487,7493 ****
    if (pedantic) {
      SKIP_WHITE_SPACE (buf);
      if (buf != limit)
!       pedwarn ("text following `#endif' violates ANSI standard");
    }

    if (if_stack == instack[indepth].if_stack)
--- 7487,7493 ----
    if (pedantic) {
      SKIP_WHITE_SPACE (buf);
      if (buf != limit)
!       error("text following `#endif' violates ANSI standard");
    }

    if (if_stack == instack[indepth].if_stack)
***************
*** 7577,7583 ****
      } else break;
    }
    if (*p != '\n')
!     pedwarn ("text following `#else' or `#endif' violates ANSI standard");
  }



  /* Skip a comment, assuming the input ptr immediately follows the
--- 7577,7583 ----
      } else break;
    }
    if (*p != '\n')
!     error("text following `#else' or `#endif' violates ANSI standard");
  }



  /* Skip a comment, assuming the input ptr immediately follows the
***************
*** 7885,7893 ****
    }

    line_directive_buf = (char *) alloca (4 * strlen (ip->nominal_fname) + 100);
!   sprintf (line_directive_buf, "# %d ", ip->lineno);
    line_end = quote_string (line_directive_buf + strlen (line_directive_buf),
  			   ip->nominal_fname);
    if (file_change != same_file) {
      *line_end++ = ' ';
      *line_end++ = file_change == enter_file ? '1' : '2';
--- 7885,7894 ----
    }

    line_directive_buf = (char *) alloca (4 * strlen (ip->nominal_fname) + 100);
!   sprintf (line_directive_buf, "# line %d ", ip->lineno);
    line_end = quote_string (line_directive_buf + strlen (line_directive_buf),
  			   ip->nominal_fname);
+ #if 0
    if (file_change != same_file) {
      *line_end++ = ' ';
      *line_end++ = file_change == enter_file ? '1' : '2';
***************
*** 7904,7909 ****
--- 7905,7911 ----
      *line_end++ = '4';
    }
  #endif
+ #endif
    *line_end++ = '\n';
    len = line_end - line_directive_buf;
    check_expand (op, len + 1);
***************
*** 8796,8802 ****
      }

    if (ip != NULL)
!     fprintf (stderr, "%s:%d: ", ip->nominal_fname, ip->lineno);
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
    errors++;
--- 8798,8804 ----
      }

    if (ip != NULL)
!     fprintf (stderr, "%s:%d: Error: ", ip->nominal_fname, ip->lineno);
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
    errors++;
***************


David Binderman MSc BSc    +44 1293 534 847       dcb_AVOID_JUNK_MAIL@pncl.co.uk
There is no substitute for skill, taste and experience when programming
 - Dr Stroustrup, inventor of C++



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