Index: boot/arch/arm64/src/main.c
===================================================================
--- boot/arch/arm64/src/main.c	(revision 69b6dd1fdad61cf973f096c5e880336d3d2a1691)
+++ boot/arch/arm64/src/main.c	(revision 1e8b633ea4fe33de942dfc3b6dfe8d63fa018b89)
@@ -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
