aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpperror.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cpperror.c')
-rw-r--r--gcc/cpperror.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index d57238069d6..1ceb3457c66 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -29,6 +29,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "cpphash.h"
#include "intl.h"
+/* APPLE LOCAL error-colon */
+static int gcc_error_colon = 0;
static void print_location (cpp_reader *, source_location, unsigned int);
/* Print the logical file location (LINE, COL) in preparation for a
@@ -38,6 +40,23 @@ static void print_location (cpp_reader *, source_location, unsigned int);
static void
print_location (cpp_reader *pfile, source_location line, unsigned int col)
{
+ /* APPLE LOCAL begin error-colon */
+ const char *estr;
+ {
+ static int done = 0;
+ if ( ! done)
+ {
+ done = 1; /* Do this only once. */
+ /* Pretend we saw "-w" on commandline. */
+ if (getenv ("GCC_DASH_W"))
+ CPP_OPTION (pfile, inhibit_warnings) = 1; /* referenced by diagnostic.h:diagnostic_report_warnings() */
+ if (getenv ("GCC_ERROR_COLON"))
+ gcc_error_colon = 1;
+ }
+ }
+ estr = (gcc_error_colon) ? "error:" : "" ;
+ /* APPLE LOCAL end error-colon */
+
if (line == 0)
fprintf (stderr, "%s: ", progname);
else
@@ -56,12 +75,14 @@ print_location (cpp_reader *pfile, source_location line, unsigned int col)
col = 1;
}
+ /* APPLE LOCAL begin error-colon */
if (lin == 0)
- fprintf (stderr, "%s:", map->to_file);
+ fprintf (stderr, "%s:%s", map->to_file, estr);
else if (CPP_OPTION (pfile, show_column) == 0)
- fprintf (stderr, "%s:%u:", map->to_file, lin);
+ fprintf (stderr, "%s:%u:%s", map->to_file, lin, estr);
else
- fprintf (stderr, "%s:%u:%u:", map->to_file, lin, col);
+ fprintf (stderr, "%s:%u:%u:%s", map->to_file, lin, col, estr);
+ /* APPLE LOCAL end error-colon */
fputc (' ', stderr);
}