1From 7f1d554cb07e8ada1842983e8ff8fa4dfe2ecf55 Mon Sep 17 00:00:00 2001
2From: Michael Forney <mforney@mforney.org>
3Date: Tue, 18 Jun 2019 02:29:07 -0700
4Subject: [PATCH] Avoid a few unnecessary statement expressions
5
6---
7 include/c.h | 13 ++++++-------
8 1 file changed, 6 insertions(+), 7 deletions(-)
9
10diff --git a/include/c.h b/include/c.h
11index dcb2d683c..3ba42306c 100644
12--- a/include/c.h
13+++ b/include/c.h
14@@ -210,9 +210,8 @@
15 * @member: the name of the member within the struct.
16 */
17 #ifndef container_of
18-#define container_of(ptr, type, member) __extension__ ({ \
19- const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
20- (type *)( (char *)__mptr - offsetof(type,member) );})
21+#define container_of(ptr, type, member) \
22+ ((type *)( (char *)ptr - offsetof(type,member) ))
23 #endif
24
25 #define read_unaligned_member(p, m) __extension__ ({ \
26@@ -310,11 +309,11 @@ void __err_oom(const char *file, unsigned int line)
27
28 /* Don't use inline function to avoid '#include "nls.h"' in c.h
29 */
30-#define errtryhelp(eval) __extension__ ({ \
31+#define errtryhelp(eval) do { \
32 fprintf(stderr, _("Try '%s --help' for more information.\n"), \
33 program_invocation_short_name); \
34 exit(eval); \
35-})
36+} while (0)
37
38 /* After failed execvp() */
39 #define EX_EXEC_FAILED 126 /* Program located, but not usable. */
40@@ -481,10 +480,10 @@ static inline void __attribute__((__noreturn__)) ul_sig_err(int excode, const ch
41
42 #define UTIL_LINUX_VERSION _("%s from %s\n"), program_invocation_short_name, PACKAGE_STRING
43
44-#define print_version(eval) __extension__ ({ \
45+#define print_version(eval) do { \
46 printf(UTIL_LINUX_VERSION); \
47 exit(eval); \
48-})
49+} while (0)
50
51 static inline void print_features(const char *const*features, const char *prefix)
52 {
53--
542.49.0
55