From: whitequark Date: Fri, 19 Jun 2020 01:05:59 +0000 (+0000) Subject: Use C++11 [[noreturn]] attribute. X-Git-Tag: working-ls180~460^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60478a8e3a7b929ea7e4f4cd1b538b41ca1f34bb;p=yosys.git Use C++11 [[noreturn]] attribute. --- diff --git a/kernel/log.cc b/kernel/log.cc index 104bee078..1c1d0182e 100644 --- a/kernel/log.cc +++ b/kernel/log.cc @@ -319,7 +319,7 @@ void log_file_info(const std::string &filename, int lineno, va_end(ap); } -YS_ATTRIBUTE(noreturn) +[[noreturn]] static void logv_error_with_prefix(const char *prefix, const char *format, va_list ap) { diff --git a/kernel/log.h b/kernel/log.h index 63590c489..9a6c2a8e6 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -139,7 +139,7 @@ void logv(const char *format, va_list ap); void logv_header(RTLIL::Design *design, const char *format, va_list ap); void logv_warning(const char *format, va_list ap); void logv_warning_noprefix(const char *format, va_list ap); -YS_NORETURN void logv_error(const char *format, va_list ap) YS_ATTRIBUTE(noreturn); +[[noreturn]] void logv_error(const char *format, va_list ap); void log(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2)); void log_header(RTLIL::Design *design, const char *format, ...) YS_ATTRIBUTE(format(printf, 2, 3)); @@ -151,9 +151,9 @@ void log_file_warning(const std::string &filename, int lineno, const char *forma void log_file_info(const std::string &filename, int lineno, const char *format, ...) YS_ATTRIBUTE(format(printf, 3, 4)); void log_warning_noprefix(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2)); -YS_NORETURN void log_error(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2), noreturn); -void log_file_error(const string &filename, int lineno, const char *format, ...) YS_ATTRIBUTE(format(printf, 3, 4), noreturn); -YS_NORETURN void log_cmd_error(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2), noreturn); +[[noreturn]] void log_error(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2)); +void log_file_error(const string &filename, int lineno, const char *format, ...) YS_ATTRIBUTE(format(printf, 3, 4)); +[[noreturn]] void log_cmd_error(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2)); #ifndef NDEBUG static inline bool ys_debug(int n = 0) { if (log_force_debug) return true; log_debug_suppressed += n; return false; } diff --git a/kernel/yosys.h b/kernel/yosys.h index 4510ee56b..b9b6b24b1 100644 --- a/kernel/yosys.h +++ b/kernel/yosys.h @@ -138,13 +138,10 @@ extern Tcl_Obj *Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *p #if defined(__GNUC__) || defined(__clang__) # define YS_ATTRIBUTE(...) __attribute__((__VA_ARGS__)) -# define YS_NORETURN #elif defined(_MSC_VER) # define YS_ATTRIBUTE(...) -# define YS_NORETURN __declspec(noreturn) #else # define YS_ATTRIBUTE(...) -# define YS_NORETURN #endif #if __cplusplus >= 201703L