From 6a5a1a8964110f7b14dfc8b0ac8d53b23f421ab4 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Tue, 29 Nov 2016 01:41:03 -0800 Subject: [PATCH] [[noreturn]] instead of __attribute__ ((noreturn)) C++11 does this, better to use a standard attribute than a compiler extension. --- src/common.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common.h b/src/common.h index 7f077bbb6..dcf43ac65 100644 --- a/src/common.h +++ b/src/common.h @@ -166,7 +166,7 @@ inline bool selection_direction_is_cardinal(selection_direction_t dir) { } while (0) /// Exits without invoking destructors (via _exit), useful for code after fork. -void exit_without_destructors(int code) __attribute__((noreturn)); +[[noreturn]] void exit_without_destructors(int code); /// Save the shell mode on startup so we can restore them on exit. extern struct termios shell_modes; @@ -210,10 +210,11 @@ extern bool has_working_tty_timestamps; return retval; \ } -/// Pause for input, then exit the program. If supported, print a backtrace first. +// Pause for input, then exit the program. If supported, print a backtrace first. // The `return` will never be run but silences oclint warnings. Especially when this is called // from within a `switch` block. As of the time I'm writing this oclint doesn't recognize the // `__attribute__((noreturn))` on the exit_without_destructors() function. +// TODO: we use C++11 [[noreturn]] now, does that change things? #define FATAL_EXIT() \ { \ char exit_read_buff; \