/[bison]/bison/src/complain.c
ViewVC logotype

Diff of /bison/src/complain.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by akim, Tue Jul 9 16:24:57 2002 UTC revision 1.12 by akim, Tue Jul 30 11:09:59 2002 UTC
# Line 1  Line 1 
1  /* Declaration for error-reporting function for Bison.  /* Declaration for error-reporting function for Bison.
2     Copyright 2000, 2001 Free Software Foundation, Inc.     Copyright (C) 2000, 2001, 2002  Free Software Foundation, Inc.
3    
4     This program is free software; you can redistribute it and/or modify it     This program is free software; you can redistribute it and/or modify it
5     under the terms of the GNU General Public License as published by the     under the terms of the GNU General Public License as published by the
# Line 142  warn_at (location, message, va_alist) Line 142  warn_at (location, message, va_alist)
142    putc ('\n', stderr);    putc ('\n', stderr);
143    fflush (stderr);    fflush (stderr);
144  }  }
145    
146    void
147    #if defined VA_START && defined __STDC__
148    warn (const char *message, ...)
149    #else
150    warn (message, va_alist)
151      char *message;
152      va_dcl
153    #endif
154    {
155    #ifdef VA_START
156      va_list args;
157    #endif
158    
159      fflush (stdout);
160      fprintf (stderr, "%s: %s", infile ? infile : program_name, _("warning: "));
161    
162    #ifdef VA_START
163      VA_START (args, message);
164      vfprintf (stderr, message, args);
165      va_end (args);
166    #else
167      fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
168    #endif
169    
170      ++warn_message_count;
171      putc ('\n', stderr);
172      fflush (stderr);
173    }
174    
175  /*-----------------------------------------------------------.  /*-----------------------------------------------------------.
176  | An error has occurred, but we can proceed, and die later.  |  | An error has occurred, but we can proceed, and die later.  |
# Line 177  complain_at (location, message, va_alist Line 206  complain_at (location, message, va_alist
206    putc ('\n', stderr);    putc ('\n', stderr);
207    fflush (stderr);    fflush (stderr);
208  }  }
209    
210    void
211    #if defined VA_START && defined __STDC__
212    complain (const char *message, ...)
213    #else
214    complain (message, va_alist)
215         char *message;
216         va_dcl
217    #endif
218    {
219    #ifdef VA_START
220      va_list args;
221    #endif
222    
223      fflush (stdout);
224      fprintf (stderr, "%s: ", infile ? infile : program_name);
225    
226    #ifdef VA_START
227      VA_START (args, message);
228      vfprintf (stderr, message, args);
229      va_end (args);
230    #else
231      fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
232    #endif
233    
234      ++complain_message_count;
235      putc ('\n', stderr);
236      fflush (stderr);
237    }
238    
239  /*-------------------------------------------------.  /*-------------------------------------------------.
240  | A severe error has occurred, we cannot proceed.  |  | A severe error has occurred, we cannot proceed.  |
# Line 186  void Line 244  void
244  #if defined VA_START && defined __STDC__  #if defined VA_START && defined __STDC__
245  fatal_at (location_t location, const char *message, ...)  fatal_at (location_t location, const char *message, ...)
246  #else  #else
247  fatal (location, message, va_alist)  fatal_at (location, message, va_alist)
248    location_t location;    location_t location;
249    char *message;    char *message;
250    va_dcl    va_dcl

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26