summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/config.h44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/config.h b/src/config.h
index ed3f6ab..e17f90b 100644
--- a/src/config.h
+++ b/src/config.h
@@ -129,18 +129,7 @@
# define __GLIBC_PREREQ(maj, min) false
#endif
-// Wrappers for fundamental language features/extensions
-
-/**
- * Silence compiler warnings about switch/case fall-throughs.
- */
-#if __has_c_attribute(fallthrough)
-# define BFS_FALLTHROUGH [[fallthrough]]
-#elif __has_attribute(fallthrough)
-# define BFS_FALLTHROUGH __attribute__((fallthrough))
-#else
-# define BFS_FALLTHROUGH ((void)0)
-#endif
+// Fundamental utilities
/**
* Get the length of an array.
@@ -170,6 +159,28 @@
: BFS_FLEX_MAX(sizeof(type), BFS_FLEX_LB(type, member, length)))
/**
+ * Initialize a variable, unless sanitizers would detect uninitialized uses.
+ */
+#if __has_feature(memory_sanitizer)
+# define BFS_UNINIT(var, value) var
+#else
+# define BFS_UNINIT(var, value) value
+#endif
+
+// Wrappers for attributes
+
+/**
+ * Silence compiler warnings about switch/case fall-throughs.
+ */
+#if __has_c_attribute(fallthrough)
+# define BFS_FALLTHROUGH [[fallthrough]]
+#elif __has_attribute(fallthrough)
+# define BFS_FALLTHROUGH __attribute__((fallthrough))
+#else
+# define BFS_FALLTHROUGH ((void)0)
+#endif
+
+/**
* Adds compiler warnings for bad printf()-style function calls, if supported.
*/
#if __has_attribute(format)
@@ -200,13 +211,4 @@
# define BFS_UNSUPPRESS()
#endif
-/**
- * Initialize a variable, unless sanitizers would detect uninitialized uses.
- */
-#if __has_feature(memory_sanitizer)
-# define BFS_UNINIT(var, value) var
-#else
-# define BFS_UNINIT(var, value) value
-#endif
-
#endif // BFS_CONFIG_H