diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2024-07-16 16:02:12 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-07-16 18:30:45 -0400 |
commit | d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3 (patch) | |
tree | b8897a470d1270148fdee39e16f54baa3907a079 /gdbsupport/errors.h | |
parent | 9153eb8a7f5449c9baa67b2349cdfc0a47104c9a (diff) | |
download | binutils-d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3.zip binutils-d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3.tar.gz binutils-d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3.tar.bz2 |
gdb, gdbserver, gdbsupport: use [[noreturn]] instead of ATTRIBUTE_NORETURN
C++ 11 has a built-in attribute for this, no need to use a compat macro.
Change-Id: I90e4220d26e8f3949d91761f8a13cd9c37da3875
Reviewed-by: Lancelot Six <lancelot.six@amd.com>
Diffstat (limited to 'gdbsupport/errors.h')
-rw-r--r-- | gdbsupport/errors.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/gdbsupport/errors.h b/gdbsupport/errors.h index d8daed0..c0747f8 100644 --- a/gdbsupport/errors.h +++ b/gdbsupport/errors.h @@ -36,11 +36,10 @@ extern void vwarning (const char *fmt, va_list args) a printf- or vprintf-style argument list. These functions do not return. The function "verror" must be provided by the client. */ -extern void error (const char *fmt, ...) - ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2); +[[noreturn]] extern void error (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2); -extern void verror (const char *fmt, va_list args) - ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0); +[[noreturn]] extern void verror (const char *fmt, va_list args) + ATTRIBUTE_PRINTF (1, 0); /* An internal error was detected. Internal errors indicate programming errors such as assertion failures, as opposed to @@ -53,16 +52,16 @@ extern void verror (const char *fmt, va_list args) automatically. The function "internal_verror" must be provided by the client. */ -extern void internal_error_loc (const char *file, int line, - const char *fmt, ...) - ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 4); +[[noreturn]] extern void internal_error_loc (const char *file, int line, + const char *fmt, ...) + ATTRIBUTE_PRINTF (3, 4); #define internal_error(fmt, ...) \ internal_error_loc (__FILE__, __LINE__, fmt, ##__VA_ARGS__) -extern void internal_verror (const char *file, int line, - const char *fmt, va_list args) - ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 0); +[[noreturn]] extern void internal_verror (const char *file, int line, + const char *fmt, va_list args) + ATTRIBUTE_PRINTF (3, 0); /* An internal problem was detected, but the requested operation can still proceed. Internal warnings indicate programming errors as @@ -93,14 +92,13 @@ extern std::string perror_string (const char *prefix, int errnum = 0); STRING with the system error message for errno. If ERRNUM is given, then use it in place of errno. This function does not return. */ -extern void perror_with_name (const char *string, int errnum = 0) - ATTRIBUTE_NORETURN; +[[noreturn]] extern void perror_with_name (const char *string, int errnum = 0); /* Call this function to handle memory allocation failures. This function does not return. This function must be provided by the client. */ -extern void malloc_failure (long size) ATTRIBUTE_NORETURN; +[[noreturn]] extern void malloc_failure (long size); /* Flush stdout and stderr. Must be provided by the client. */ @@ -124,8 +122,8 @@ extern const char *strwinerror (ULONGEST error); including STRING and the system text for the given error number. */ -extern void throw_winerror_with_name (const char *string, ULONGEST err) - ATTRIBUTE_NORETURN; +[[noreturn]] extern void throw_winerror_with_name (const char *string, + ULONGEST err); #endif /* USE_WIN32API */ |