]> granicus.if.org Git - strace/blobdiff - gcc_compat.h
nlattr: add UID/GID netlink attribute decoders
[strace] / gcc_compat.h
index 08e8117342428c8821f8fc5f0eede5668c0f9fab..251080bb518b89ddcac5aff1d6f14229bea0fee3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
- * Copyright (c) 2015-2017 The strace developers.
+ * Copyright (c) 2015-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -84,7 +84,7 @@
 #if GNUC_PREREQ(4, 1)
 # define ALIGNOF(t_)   __alignof__(t_)
 #else
-# define ALIGNOF(t_)   (sizeof(struct {char x_; t_ y_;}) - sizeof(t_))
+# define ALIGNOF(t_)   (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
 #endif
 
 #if GNUC_PREREQ(4, 3)
 # define ATTRIBUTE_ALLOC_SIZE(args)    /* empty */
 #endif
 
+#if GNUC_PREREQ(7, 0)
+# define ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__))
+#else
+# define ATTRIBUTE_FALLTHROUGH ((void) 0)
+#endif
+
+#if GNUC_PREREQ(6, 0)
+# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE                         \
+       _Pragma("GCC diagnostic push");                                 \
+       _Pragma("GCC diagnostic ignored \"-Wtautological-compare\"");
+# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE                          \
+       _Pragma("GCC diagnostic pop");
+#else
+# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
+# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE  /* empty */
+#endif
+
 #endif /* !STRACE_GCC_COMPAT_H */