Index: boot/arch/arm64/src/main.c
===================================================================
--- boot/arch/arm64/src/main.c	(revision 69b6dd1fdad61cf973f096c5e880336d3d2a1691)
+++ boot/arch/arm64/src/main.c	(revision 3e1bc3546ea213729dee23c73de611ea2141e305)
@@ -191,10 +191,8 @@
 
 	/* Statically check PAGE_SIZE and BOOT_OFFSET. */
-#if PAGE_SIZE != 4096
-#error Unsupported PAGE_SIZE
-#endif
-#if !IS_ALIGNED(BOOT_OFFSET, PAGE_SIZE)
-#error Unsupported BOOT_OFFSET
-#endif
+	_Static_assert(PAGE_SIZE == 4096, "PAGE_SIZE must be equal to 4096");
+	_Static_assert(IS_ALIGNED(BOOT_OFFSET, PAGE_SIZE),
+	    "BOOT_OFFSET must be a multiple of PAGE_SIZE");
+
 	/*
 	 * Dynamically check the memory base. The condition should be always
