mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-14 00:47:30 +00:00
[[noreturn]] instead of __attribute__ ((noreturn))
C++11 does this, better to use a standard attribute than a compiler extension.
This commit is contained in:
parent
a8b2da8405
commit
6a5a1a8964
1 changed files with 3 additions and 2 deletions
|
@ -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; \
|
||||
|
|
Loading…
Reference in a new issue