Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-void lognotice(char const *fmt, ...) {
+void lognotice(char const *fmt, ...) noexcept {
va_list a;
va_start(a, fmt);
log_("notice", stdout, fmt, a);
va_end(a);
}
va_list a;
va_start(a, fmt);
log_("notice", stdout, fmt, a);
va_end(a);
}
-void logerror(char const *fmt, ...) {
+void logerror(char const *fmt, ...) noexcept {
va_list a;
va_start(a, fmt);
log_("error", stderr, fmt, a);
va_end(a);
}
va_list a;
va_start(a, fmt);
log_("error", stderr, fmt, a);
va_end(a);
}
-void fatal(char const *fmt, ...) {
+void fatal(char const *fmt, ...) noexcept {
va_list a;
va_start(a, fmt);
log_("fatal", stderr, fmt, a);
va_list a;
va_start(a, fmt);
log_("fatal", stderr, fmt, a);
-void logdebug(char const *fmt, ...) {
+void logdebug(char const *fmt, ...) noexcept {
va_list a;
va_start(a, fmt);
log_("debug", stdout, fmt, a);
va_list a;
va_start(a, fmt);
log_("debug", stdout, fmt, a);
#ifdef __GNUC__
#define ATTR_FORMAT(stringindex, firsttocheck) \
__attribute__((format(printf, stringindex, firsttocheck)))
#ifdef __GNUC__
#define ATTR_FORMAT(stringindex, firsttocheck) \
__attribute__((format(printf, stringindex, firsttocheck)))
+#define ATTR_NORETURN __attribute__((noreturn))
#else
#define ATTR_FORMAT(stringindex, firsttocheck)
#else
#define ATTR_FORMAT(stringindex, firsttocheck)
-void lognotice(char const *fmt, ...) ATTR_FORMAT(1, 2);
-void logerror(char const *fmt, ...) ATTR_FORMAT(1, 2);
-void fatal(char const *fmt, ...) ATTR_FORMAT(1, 2);
+void lognotice(char const *fmt, ...) noexcept ATTR_FORMAT(1, 2);
+void logerror(char const *fmt, ...) noexcept ATTR_FORMAT(1, 2);
+void fatal(char const *fmt, ...) noexcept ATTR_FORMAT(1, 2) ATTR_NORETURN;
-void logdebug(char const *fmt, ...) ATTR_FORMAT(1, 2);
+void logdebug(char const *fmt, ...) noexcept ATTR_FORMAT(1, 2);
-static inline void logdebug(char const *fmt, ...) ATTR_FORMAT(1, 2);
-static inline void logdebug(char const *fmt, ...) {}
+static inline void logdebug(char const *fmt, ...) noexcept ATTR_FORMAT(1, 2);
+static inline void logdebug(char const *fmt, ...) noexcept {}
//
// ___ ___ _ __ ___ ___ _ __
// / __|/ __| '__/ _ \/ _ \ '_ \
//
// ___ ___ _ __ ___ ___ _ __
// / __|/ __| '__/ _ \/ _ \ '_ \