/[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.8 by akim, Tue Jun 11 20:16:05 2002 UTC revision 1.9 by akim, Sat Jun 15 18:21:46 2002 UTC
# Line 116  unsigned int complain_message_count; Line 116  unsigned int complain_message_count;
116    
117  void  void
118  #if defined VA_START && defined __STDC__  #if defined VA_START && defined __STDC__
119  warn_at (int location, const char *message, ...)  warn_at (location_t location, const char *message, ...)
120  #else  #else
121  warn_at (location, message, va_alist)  warn_at (location, message, va_alist)
122    int location    location_t location
123    char *message;    char *message;
124    va_dcl    va_dcl
125  #endif  #endif
# Line 133  warn_at (location, message, va_alist) Line 133  warn_at (location, message, va_alist)
133        static const char *old_infile;        static const char *old_infile;
134        static int old_lineno;        static int old_lineno;
135    
136        if (old_lineno == location &&        if (old_lineno == location.first_line &&
137            (infile == old_infile || !strcmp (old_infile, infile)))            (infile == old_infile || !strcmp (old_infile, infile)))
138          /* Simply return and print nothing.  */          /* Simply return and print nothing.  */
139          return;          return;
140    
141        old_infile = infile;        old_infile = infile;
142        old_lineno = location;        old_lineno = location.first_line;
143      }      }
144    
145    fflush (stdout);    fflush (stdout);
146    if (infile != NULL)    LOCATION_PRINT (stderr, location);
147      fprintf (stderr, "%s:%d: ", infile, location);    fputs (": ", stderr);
   else  
     fprintf (stderr, "%s:", program_name);  
   
148    fputs (_("warning: "), stderr);    fputs (_("warning: "), stderr);
149    
150  #ifdef VA_START  #ifdef VA_START
# Line 218  warn (message, va_alist) Line 215  warn (message, va_alist)
215    
216  void  void
217  #if defined VA_START && defined __STDC__  #if defined VA_START && defined __STDC__
218  complain_at (int location, const char *message, ...)  complain_at (location_t location, const char *message, ...)
219  #else  #else
220  complain_at (location, message, va_alist)  complain_at (location, message, va_alist)
221    int location;    location_t location;
222    char *message;    char *message;
223    va_dcl    va_dcl
224  #endif  #endif
# Line 235  complain_at (location, message, va_alist Line 232  complain_at (location, message, va_alist
232        static const char *old_infile;        static const char *old_infile;
233        static int old_lineno;        static int old_lineno;
234    
235        if (old_lineno == location &&        if (old_lineno == location.first_line &&
236            (infile == old_infile || !strcmp (old_infile, infile)))            (infile == old_infile || !strcmp (old_infile, infile)))
237          /* Simply return and print nothing.  */          /* Simply return and print nothing.  */
238          return;          return;
239    
240        old_infile = infile;        old_infile = infile;
241        old_lineno = location;        old_lineno = location.first_line;
242      }      }
243    
244    fflush (stdout);    fflush (stdout);
245    if (infile != NULL)    LOCATION_PRINT (stderr, location);
246      fprintf (stderr, "%s:%d: ", infile, location);    fputs (": ", stderr);
   else  
     fprintf (stderr, "%s:", program_name);  
247    
248  #ifdef VA_START  #ifdef VA_START
249    VA_START (args, message);    VA_START (args, message);
# Line 316  complain (message, va_alist) Line 311  complain (message, va_alist)
311    
312  void  void
313  #if defined VA_START && defined __STDC__  #if defined VA_START && defined __STDC__
314  fatal_at (int location, const char *message, ...)  fatal_at (location_t location, const char *message, ...)
315  #else  #else
316  fatal (location, message, va_alist)  fatal (location, message, va_alist)
317    int location;    location_t location;
318    char *message;    char *message;
319    va_dcl    va_dcl
320  #endif  #endif
# Line 329  fatal (location, message, va_alist) Line 324  fatal (location, message, va_alist)
324  #endif  #endif
325    
326    fflush (stdout);    fflush (stdout);
327    if (infile != NULL)    LOCATION_PRINT (stderr, location);
328      fprintf (stderr, "%s:%d: ", infile, location);    fputs (": ", stderr);
   else  
     fprintf (stderr, "%s:", program_name);  
   
329    fputs (_("fatal error: "), stderr);    fputs (_("fatal error: "), stderr);
330    
331  #ifdef VA_START  #ifdef VA_START

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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