Index: kernel/generic/include/debug.h
===================================================================
--- kernel/generic/include/debug.h	(revision 2a0800506a1ff0ea264a43ef534635ebf6a0734e)
+++ kernel/generic/include/debug.h	(revision b2fa2d86f31fd2f3a0ce7dad1f5039f5efa891f1)
@@ -77,8 +77,20 @@
 	} while (0)
 
+/** Static assert macro
+ *
+ */
+#define STATIC_ASSERT(expr) \
+	_Static_assert(expr, "")
+
+#define STATIC_ASSERT_VERBOSE(expr, msg) \
+	_Static_assert(expr, msg)
+
+
 #else /* CONFIG_DEBUG */
 
 #define ASSERT(expr)
 #define ASSERT_VERBOSE(expr, msg)
+#define STATIC_ASSERT(expr)
+#define STATIC_ASSERT_VERBOSE(expr, msg)
 
 #endif /* CONFIG_DEBUG */
Index: kernel/generic/include/printf/verify.h
===================================================================
--- kernel/generic/include/printf/verify.h	(revision 2a0800506a1ff0ea264a43ef534635ebf6a0734e)
+++ kernel/generic/include/printf/verify.h	(revision b2fa2d86f31fd2f3a0ce7dad1f5039f5efa891f1)
@@ -38,6 +38,12 @@
 #ifndef NVERIFY_PRINTF
 
+#ifdef __clang__
+#define PRINTF_ATTRIBUTE(start, end) \
+	__attribute__((format(__printf__, start, end)))
+#else
 #define PRINTF_ATTRIBUTE(start, end) \
 	__attribute__((format(gnu_printf, start, end)))
+#endif
+
 
 #else /* NVERIFY_PRINTF */
Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision 2a0800506a1ff0ea264a43ef534635ebf6a0734e)
+++ kernel/generic/src/main/main.c	(revision b2fa2d86f31fd2f3a0ce7dad1f5039f5efa891f1)
@@ -89,4 +89,23 @@
 #include <lib/ra.h>
 
+/* Ensure [u]int*_t types are of correct size.
+ *
+ * Probably, this is not the best place for such tests
+ * but this file is compiled on all architectures.
+ */
+#define CHECK_INT_TYPE_(signness, size) \
+	STATIC_ASSERT_VERBOSE(sizeof(signness##size##_t) * 8 == size, \
+	    #signness #size "_t does not have " #size " bits");
+#define CHECK_INT_TYPE(size) \
+	CHECK_INT_TYPE_(int, size); CHECK_INT_TYPE_(uint, size)
+
+CHECK_INT_TYPE(8);
+CHECK_INT_TYPE(16);
+CHECK_INT_TYPE(32);
+CHECK_INT_TYPE(64);
+
+
+
+
 /** Global configuration structure. */
 config_t config = {
