summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2021-06-01 18:36:17 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2021-06-01 18:40:59 -0700
commitcd0fba98a2d0867d505ff1a7ca8d7a7c757acfa2 (patch)
tree231b391c3bd9374438b1b83e7e2295f288a3bd8c /src
parent2ef8655987b9862cdddb72223c9f259a860d5777 (diff)
xcb_auth: Quiet -Wimplicit-fallthrough warning in get_authptr()
xcb_auth.c:135:14: warning: this statement may fall through [-Wimplicit-fallthrough=] addr += 12; ~~~~~^~~~~ xcb_auth.c:138:5: note: here case AF_INET: ^~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src')
-rw-r--r--src/xcb_auth.c1
-rw-r--r--src/xcbint.h10
2 files changed, 11 insertions, 0 deletions
diff --git a/src/xcb_auth.c b/src/xcb_auth.c
index 26eebbb..6937afb 100644
--- a/src/xcb_auth.c
+++ b/src/xcb_auth.c
@@ -134,6 +134,7 @@ static Xauth *get_authptr(struct sockaddr *sockname, int display)
}
addr += 12;
/* if v4-mapped, fall through. */
+ XCB_ALLOW_FALLTHRU
#endif
case AF_INET:
if(!addr)
diff --git a/src/xcbint.h b/src/xcbint.h
index cef9821..524d6c7 100644
--- a/src/xcbint.h
+++ b/src/xcbint.h
@@ -38,6 +38,16 @@
#pragma GCC visibility push(hidden)
#endif
+#ifndef __has_attribute
+# define __has_attribute(x) 0 /* Compatibility with older compilers. */
+#endif
+
+#if __has_attribute(fallthrough)
+# define XCB_ALLOW_FALLTHRU __attribute__ ((fallthrough));
+#else
+# define XCB_ALLOW_FALLTHRU /* FALLTHRU */
+#endif
+
enum workarounds {
WORKAROUND_NONE,
WORKAROUND_GLX_GET_FB_CONFIGS_BUG,