7b1f28590c213b9b2979776ffb25fe3f0af9fa5d
[external/binutils.git] / gdb / common / errors.c
1 /* Error reporting facilities.
2
3    Copyright (C) 1986-2017 Free Software Foundation, Inc.
4
5    This file is part of GDB.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
20 #include "common-defs.h"
21 #include "errors.h"
22
23 /* See common/errors.h.  */
24
25 void
26 warning (const char *fmt, ...)
27 {
28   va_list ap;
29
30   va_start (ap, fmt);
31   vwarning (fmt, ap);
32   va_end (ap);
33 }
34
35 /* See common/errors.h.  */
36
37 void
38 error (const char *fmt, ...)
39 {
40   va_list ap;
41
42   va_start (ap, fmt);
43   verror (fmt, ap);
44   va_end (ap);
45 }
46
47 /* See common/errors.h.  */
48
49 void
50 internal_error (const char *file, int line, const char *fmt, ...)
51 {
52   va_list ap;
53
54   va_start (ap, fmt);
55   internal_verror (file, line, fmt, ap);
56   va_end (ap);
57 }
58
59 /* See common/errors.h.  */
60
61 void
62 internal_warning (const char *file, int line, const char *fmt, ...)
63 {
64   va_list ap;
65
66   va_start (ap, fmt);
67   internal_vwarning (file, line, fmt, ap);
68   va_end (ap);
69 }