diff options
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 5350d0c5531..e6ba94d55c7 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -61,12 +61,19 @@ static void real_abort (void) ATTRIBUTE_NORETURN; static diagnostic_context global_diagnostic_context; diagnostic_context *global_dc = &global_diagnostic_context; +/* APPLE LOCAL error-colon */ +static int gcc_error_colon = 0; + /* Boilerplate text used in two locations. */ #define bug_report_request \ "Please submit a full bug report,\n\ with preprocessed source if appropriate.\n\ See %s for instructions.\n" +/* APPLE LOCAL insert assembly ".abort" directive on fatal error */ +#ifdef EXIT_FROM_FATAL_DIAGNOSTIC +#define exit(status) EXIT_FROM_FATAL_DIAGNOSTIC (status) +#endif /* Return a malloc'd string containing MSG formatted a la printf. The caller is responsible for freeing the memory. */ @@ -87,6 +94,11 @@ build_message_string (const char *msg, ...) char * file_name_as_prefix (const char *f) { + /* APPLE LOCAL begin error-colon */ + if (gcc_error_colon) + return build_message_string ("%s: error: ", f); + else + /* APPLE LOCAL end error-colon */ return build_message_string ("%s: ", f); } @@ -190,6 +202,23 @@ diagnostic_count_diagnostic (diagnostic_context *context, diagnostic_info *diagnostic) { diagnostic_t kind = diagnostic->kind; + + /* APPLE LOCAL begin error-colon */ + /* Here so it gets executed early on. */ + { + static int done = 0; + if (!done) + { + done = 1; /* Do this only once. */ + /* Pretend we saw "-w" on commandline. */ + if (getenv ("GCC_DASH_W")) + inhibit_warnings = 1; /* referenced by diagnostic.h:diagnostic_report_warnings() */ + if (getenv ("GCC_ERROR_COLON")) + gcc_error_colon = 1; + } + } + /* APPLE LOCAL end error-colon */ + switch (kind) { default: |