/* Handle errors.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
- Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
Contributed by Andy Vaught & Niels Kristian Bech Jensen
This file is part of GCC.
{
if (cur_error_buffer->index >= cur_error_buffer->allocated)
{
- cur_error_buffer->allocated =
- cur_error_buffer->allocated
- ? cur_error_buffer->allocated * 2 : 1000;
- cur_error_buffer->message
- = xrealloc (cur_error_buffer->message,
- cur_error_buffer->allocated);
+ cur_error_buffer->allocated = cur_error_buffer->allocated
+ ? cur_error_buffer->allocated * 2 : 1000;
+ cur_error_buffer->message = xrealloc (cur_error_buffer->message,
+ cur_error_buffer->allocated);
}
cur_error_buffer->message[cur_error_buffer->index++] = c;
}
static void error_printf (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
static void
-show_locus (locus * loc, int c1, int c2)
+show_locus (locus *loc, int c1, int c2)
{
gfc_linebuf *lb;
gfc_file *f;
if (cmax > terminal_width - 5)
offset = cmax - terminal_width + 5;
- /* TODO: Is there a good reason for the following apparently-redundant
- check, and the similar ones in the single-locus cases below? */
-
- if (offset < 0)
- offset = 0;
-
/* Show the line itself, taking care not to print more than what can
show up on the terminal. Tabs are converted to spaces, and
nonprintable characters are converted to a "\xNN" sequence. */
loci may or may not be on the same source line. */
static void
-show_loci (locus * l1, locus * l2)
+show_loci (locus *l1, locus *l2)
{
int m, c1, c2;
show_locus (l1, c1, c2);
return;
-
}
continue;
if (*format == '%')
- continue;
+ {
+ format++;
+ continue;
+ }
if (ISDIGIT (*format))
{
}
format++;
- if (ISDIGIT(*format))
+ if (ISDIGIT (*format))
{
/* This is a position specifier. See comment above. */
- while (ISDIGIT(*format))
+ while (ISDIGIT (*format))
+ format++;
/* Skip over the dollar sign. */
format++;
va_list argp;
bool warning;
- warning = ((gfc_option.warn_std & std) != 0)
- && !inhibit_warnings;
- if ((gfc_option.allow_std & std) != 0
- && !warning)
+ warning = ((gfc_option.warn_std & std) != 0) && !inhibit_warnings;
+ if ((gfc_option.allow_std & std) != 0 && !warning)
return SUCCESS;
if (gfc_suppress_error)
return warning ? SUCCESS : FAILURE;
cur_error_buffer = (warning && !warnings_are_errors)
- ? &warning_buffer : &error_buffer;
+ ? &warning_buffer : &error_buffer;
cur_error_buffer->flag = 1;
cur_error_buffer->index = 0;
/* Save the existing error state. */
void
-gfc_push_error (gfc_error_buf * err)
+gfc_push_error (gfc_error_buf *err)
{
err->flag = error_buffer.flag;
if (error_buffer.flag)
/* Restore a previous pushed error state. */
void
-gfc_pop_error (gfc_error_buf * err)
+gfc_pop_error (gfc_error_buf *err)
{
error_buffer.flag = err->flag;
if (error_buffer.flag)
/* Free a pushed error state, but keep the current error state. */
void
-gfc_free_error (gfc_error_buf * err)
+gfc_free_error (gfc_error_buf *err)
{
if (err->flag)
gfc_free (err->message);