linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

0002-Avoid-a-few-unnecessary-statement-expressions.patch

(1661B)


      1 From edb05302e2c747253afd4698bc445e36c8726306 Mon Sep 17 00:00:00 2001
      2 From: Michael Forney <mforney@mforney.org>
      3 Date: Tue, 18 Jun 2019 02:29:07 -0700
      4 Subject: [PATCH] Avoid a few unnecessary statement expressions
      5 
      6 ---
      7  include/c.h | 13 ++++++-------
      8  1 file changed, 6 insertions(+), 7 deletions(-)
      9 
     10 diff --git a/include/c.h b/include/c.h
     11 index b891ad480..b420b5187 100644
     12 --- a/include/c.h
     13 +++ b/include/c.h
     14 @@ -176,9 +176,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  #ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
     26 @@ -256,11 +255,11 @@ errmsg(char doexit, int excode, char adderr, const char *fmt, ...)
     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 @@ -387,10 +386,10 @@ static inline int xusleep(useconds_t usec)
     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  /*
     52   * seek stuff
     53 -- 
     54 2.31.1
     55