]> granicus.if.org Git - python/commitdiff
mark fatal_error as noreturn (#4563)
authorBenjamin Peterson <benjamin@python.org>
Sat, 25 Nov 2017 21:02:55 +0000 (13:02 -0800)
committerGitHub <noreply@github.com>
Sat, 25 Nov 2017 21:02:55 +0000 (13:02 -0800)
clang can't figure out that fatal_error is noreturn itself and emits warnings:

../cpython/Python/pylifecycle.c:2116:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
}
^
../cpython/Python/pylifecycle.c:2125:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
}
^

Python/pylifecycle.c

index 868ac8450d453c5f25fec7bc0c7ae66b691e2437..b89cbc88d4b90ef0321d1b706701f3e96d75ae8b 100644 (file)
@@ -2048,7 +2048,7 @@ fatal_output_debug(const char *msg)
 }
 #endif
 
-static void
+static void _Py_NO_RETURN
 fatal_error(const char *prefix, const char *msg, int status)
 {
     const int fd = fileno(stderr);