ucx/cx/common.h

branch
dav-2
changeset 886
da79af4baec8
parent 854
1c8401ece69e
child 889
42cdbf9bbd49
--- a/ucx/cx/common.h	Tue Sep 09 16:01:30 2025 +0200
+++ b/ucx/cx/common.h	Tue Sep 09 20:56:47 2025 +0200
@@ -46,7 +46,7 @@
  * Repositories:<br>
  * <a href="https://sourceforge.net/p/ucx/code">https://sourceforge.net/p/ucx/code</a>
  * -&nbsp;or&nbsp;-
- * <a href="https://develop.uap-core.de/hg/ucx">https://develop.uap-core.de/hg/ucx</a>
+ * <a href="https://uap-core.de/hg/ucx">https://uap-core.de/hg/ucx</a>
  * </p>
  *
  * <h2>LICENCE</h2>
@@ -131,6 +131,11 @@
 #endif
 
 /**
+ * Inform the compiler that falling through a switch case is intentional.
+ */
+#define cx_attr_fallthrough __attribute__((__fallthrough__))
+
+/**
  * All pointer arguments must be non-NULL.
  */
 #define cx_attr_nonnull __attribute__((__nonnull__))
@@ -150,7 +155,7 @@
  */
 #define cx_attr_malloc __attribute__((__malloc__))
 
-#ifndef __clang__
+#if !defined(__clang__) && __GNUC__ >= 11
 /**
  * The pointer returned by the attributed function is supposed to be freed
  * by @p freefunc.
@@ -240,20 +245,6 @@
  */
 #define cx_attr_access_w(...) cx_attr_access(__write_only__, __VA_ARGS__)
 
-#if __STDC_VERSION__ >= 202300L
-
-/**
- * Do not warn about unused variable.
- */
-#define cx_attr_unused [[maybe_unused]]
-
-/**
- * Warn about discarded return value.
- */
-#define cx_attr_nodiscard [[nodiscard]]
-
-#else // no C23
-
 /**
  * Do not warn about unused variable.
  */
@@ -264,8 +255,6 @@
  */
 #define cx_attr_nodiscard __attribute__((__warn_unused_result__))
 
-#endif // __STDC_VERSION__
-
 
 // ---------------------------------------------------------------------------
 //       MSVC specifics

mercurial