comparison gcc/errors.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents 77e2b8dfacca
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Basic error reporting routines. 1 /* Basic error reporting routines.
2 Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008 2 Copyright (C) 1999-2017 Free Software Foundation, Inc.
3 Free Software Foundation, Inc.
4 3
5 This file is part of GCC. 4 This file is part of GCC.
6 5
7 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
20 19
21 /* warning, error, and fatal. These definitions are suitable for use 20 /* warning, error, and fatal. These definitions are suitable for use
22 in the generator programs; the compiler has a more elaborate suite 21 in the generator programs; the compiler has a more elaborate suite
23 of diagnostic printers, found in diagnostic.c. */ 22 of diagnostic printers, found in diagnostic.c. */
24 23
25 #ifdef GENERATOR_FILE 24 #ifdef HOST_GENERATOR_FILE
25 #include "config.h"
26 #define GENERATOR_FILE 1
27 #else
26 #include "bconfig.h" 28 #include "bconfig.h"
27 #else
28 #include "config.h"
29 #endif 29 #endif
30 #include "system.h" 30 #include "system.h"
31 #include "errors.h" 31 #include "errors.h"
32 32
33 /* Set this to argv[0] at the beginning of main. */ 33 /* Set this to argv[0] at the beginning of main. */
47 47
48 va_start (ap, format); 48 va_start (ap, format);
49 fprintf (stderr, "%s: warning: ", progname); 49 fprintf (stderr, "%s: warning: ", progname);
50 vfprintf (stderr, format, ap); 50 vfprintf (stderr, format, ap);
51 va_end (ap); 51 va_end (ap);
52 fputc('\n', stderr); 52 fputc ('\n', stderr);
53 } 53 }
54 54
55 55
56 /* Print an error message - we keep going but the output is unusable. */ 56 /* Print an error message - we keep going but the output is unusable. */
57 57
62 62
63 va_start (ap, format); 63 va_start (ap, format);
64 fprintf (stderr, "%s: ", progname); 64 fprintf (stderr, "%s: ", progname);
65 vfprintf (stderr, format, ap); 65 vfprintf (stderr, format, ap);
66 va_end (ap); 66 va_end (ap);
67 fputc('\n', stderr); 67 fputc ('\n', stderr);
68 68
69 have_error = 1; 69 have_error = 1;
70 } 70 }
71 71
72 72
79 79
80 va_start (ap, format); 80 va_start (ap, format);
81 fprintf (stderr, "%s: ", progname); 81 fprintf (stderr, "%s: ", progname);
82 vfprintf (stderr, format, ap); 82 vfprintf (stderr, format, ap);
83 va_end (ap); 83 va_end (ap);
84 fputc('\n', stderr); 84 fputc ('\n', stderr);
85 exit (FATAL_EXIT_CODE); 85 exit (FATAL_EXIT_CODE);
86 } 86 }
87 87
88 /* Similar, but say we got an internal error. */ 88 /* Similar, but say we got an internal error. */
89 89