1 /* Declarations for error-reporting facilities.
3 Copyright (C) 1986-2017 Free Software Foundation, Inc.
5 This file is part of GDB.
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.
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.
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/>. */
20 #ifndef COMMON_ERRORS_H
21 #define COMMON_ERRORS_H
23 /* A problem was detected, but the requested operation can still
24 proceed. A warning message is constructed using a printf- or
25 vprintf-style argument list. The function "vwarning" must be
26 provided by the client. */
28 extern void warning (const char *fmt
, ...)
29 ATTRIBUTE_PRINTF (1, 2);
31 extern void vwarning (const char *fmt
, va_list args
)
32 ATTRIBUTE_PRINTF (1, 0);
34 /* A non-predictable, non-fatal error was detected. The requested
35 operation cannot proceed. An error message is constructed using
36 a printf- or vprintf-style argument list. These functions do not
37 return. The function "verror" must be provided by the client. */
39 extern void error (const char *fmt
, ...)
40 ATTRIBUTE_NORETURN
ATTRIBUTE_PRINTF (1, 2);
42 extern void verror (const char *fmt
, va_list args
)
43 ATTRIBUTE_NORETURN
ATTRIBUTE_PRINTF (1, 0);
45 /* An internal error was detected. Internal errors indicate
46 programming errors such as assertion failures, as opposed to
47 more general errors beyond the application's control. These
48 functions do not return. An error message is constructed using
49 a printf- or vprintf-style argument list. FILE and LINE
50 indicate the file and line number where the programming error
51 was detected. The function "internal_verror" must be provided
54 extern void internal_error (const char *file
, int line
,
56 ATTRIBUTE_NORETURN
ATTRIBUTE_PRINTF (3, 4);
58 extern void internal_verror (const char *file
, int line
,
59 const char *fmt
, va_list args
)
60 ATTRIBUTE_NORETURN
ATTRIBUTE_PRINTF (3, 0);
62 /* An internal problem was detected, but the requested operation can
63 still proceed. Internal warnings indicate programming errors as
64 opposed to more general issues beyond the application's control.
65 A warning message is constructed using a printf- or vprintf-style
66 argument list. The function "internal_vwarning" must be provided
69 extern void internal_warning (const char *file
, int line
,
71 ATTRIBUTE_PRINTF (3, 4);
73 extern void internal_vwarning (const char *file
, int line
,
74 const char *fmt
, va_list args
)
75 ATTRIBUTE_PRINTF (3, 0);
78 /* Like "error", but the error message is constructed by combining
79 STRING with the system error message for errno. This function does
80 not return. This function must be provided by the client. */
82 extern void perror_with_name (const char *string
) ATTRIBUTE_NORETURN
;
84 /* Call this function to handle memory allocation failures. This
85 function does not return. This function must be provided by the
88 extern void malloc_failure (long size
) ATTRIBUTE_NORETURN
;
90 #endif /* COMMON_ERRORS_H */
This page took 0.030897 seconds and 4 git commands to generate.