aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-07-16 16:02:12 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2024-07-16 18:30:45 -0400
commitd9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3 (patch)
treeb8897a470d1270148fdee39e16f54baa3907a079 /gdbsupport
parent9153eb8a7f5449c9baa67b2349cdfc0a47104c9a (diff)
downloadgdb-d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3.zip
gdb-d9deb60b2e9e94b532f43a7d3ddddf5ddf6dbdd3.tar.gz
gdb-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')
-rw-r--r--gdbsupport/common-exceptions.cc2
-rw-r--r--gdbsupport/common-exceptions.h27
-rw-r--r--gdbsupport/errors.h28
3 files changed, 27 insertions, 30 deletions
diff --git a/gdbsupport/common-exceptions.cc b/gdbsupport/common-exceptions.cc
index 5aa1612..8301fb5 100644
--- a/gdbsupport/common-exceptions.cc
+++ b/gdbsupport/common-exceptions.cc
@@ -191,7 +191,7 @@ throw_exception (gdb_exception &&exception)
gdb_assert_not_reached ("invalid return reason");
}
-static void ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 0)
+[[noreturn]] static void ATTRIBUTE_PRINTF (3, 0)
throw_it (enum return_reason reason, enum errors error, const char *fmt,
va_list ap)
{
diff --git a/gdbsupport/common-exceptions.h b/gdbsupport/common-exceptions.h
index ffc02d2..8f53cd4 100644
--- a/gdbsupport/common-exceptions.h
+++ b/gdbsupport/common-exceptions.h
@@ -336,27 +336,26 @@ struct gdb_quit_bad_alloc
/* Throw an exception (as described by "struct gdb_exception"),
landing in the inner most containing exception handler established
using TRY/CATCH. */
-extern void throw_exception (gdb_exception &&exception)
- ATTRIBUTE_NORETURN;
+[[noreturn]] extern void throw_exception (gdb_exception &&exception);
/* Throw an exception by executing a LONG JUMP to the inner most
containing exception handler established using TRY_SJLJ. Necessary
in some cases where we need to throw GDB exceptions across
third-party library code (e.g., readline). */
-extern void throw_exception_sjlj (const struct gdb_exception &exception)
- ATTRIBUTE_NORETURN;
+[[noreturn]] extern void throw_exception_sjlj (const gdb_exception &exception);
/* Convenience wrappers around throw_exception that throw GDB
errors. */
-extern void throw_verror (enum errors, const char *fmt, va_list ap)
- ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 0);
-extern void throw_vquit (const char *fmt, va_list ap)
- ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
-extern void throw_error (enum errors error, const char *fmt, ...)
- ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 3);
-extern void throw_quit (const char *fmt, ...)
- ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
-extern void throw_forced_quit (const char *fmt, ...)
- ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+[[noreturn]] extern void throw_verror (enum errors, const char *fmt,
+ va_list ap)
+ ATTRIBUTE_PRINTF (2, 0);
+[[noreturn]] extern void throw_vquit (const char *fmt, va_list ap)
+ ATTRIBUTE_PRINTF (1, 0);
+[[noreturn]] extern void throw_error (enum errors error, const char *fmt, ...)
+ ATTRIBUTE_PRINTF (2, 3);
+[[noreturn]] extern void throw_quit (const char *fmt, ...)
+ ATTRIBUTE_PRINTF (1, 2);
+[[noreturn]] [[noreturn]] extern void throw_forced_quit (const char *fmt, ...)
+ ATTRIBUTE_PRINTF (1, 2);
#endif /* COMMON_COMMON_EXCEPTIONS_H */
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 */