Files
oasis-linux-mirror/pkg/util-linux/patch/0002-Avoid-a-few-unnecessary-statement-expressions.patch
Michael Forney 18ca169d2c util-linux: Update to 2.41.3
Also, switch to tar archive for pre-generated man pages.
2026-03-12 23:47:05 -07:00

56 lines
1.7 KiB
Diff

From 7f1d554cb07e8ada1842983e8ff8fa4dfe2ecf55 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Tue, 18 Jun 2019 02:29:07 -0700
Subject: [PATCH] Avoid a few unnecessary statement expressions
---
include/c.h | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/include/c.h b/include/c.h
index dcb2d683c..3ba42306c 100644
--- a/include/c.h
+++ b/include/c.h
@@ -210,9 +210,8 @@
* @member: the name of the member within the struct.
*/
#ifndef container_of
-#define container_of(ptr, type, member) __extension__ ({ \
- const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
+#define container_of(ptr, type, member) \
+ ((type *)( (char *)ptr - offsetof(type,member) ))
#endif
#define read_unaligned_member(p, m) __extension__ ({ \
@@ -310,11 +309,11 @@ void __err_oom(const char *file, unsigned int line)
/* Don't use inline function to avoid '#include "nls.h"' in c.h
*/
-#define errtryhelp(eval) __extension__ ({ \
+#define errtryhelp(eval) do { \
fprintf(stderr, _("Try '%s --help' for more information.\n"), \
program_invocation_short_name); \
exit(eval); \
-})
+} while (0)
/* After failed execvp() */
#define EX_EXEC_FAILED 126 /* Program located, but not usable. */
@@ -481,10 +480,10 @@ static inline void __attribute__((__noreturn__)) ul_sig_err(int excode, const ch
#define UTIL_LINUX_VERSION _("%s from %s\n"), program_invocation_short_name, PACKAGE_STRING
-#define print_version(eval) __extension__ ({ \
+#define print_version(eval) do { \
printf(UTIL_LINUX_VERSION); \
exit(eval); \
-})
+} while (0)
static inline void print_features(const char *const*features, const char *prefix)
{
--
2.49.0