Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision 273c9760404837a4e66cf21f18aa616b1834bd9a)
+++ kernel/Makefile	(revision f3386d746b4f2e3d741eb9009428dbd331e2b6b1)
@@ -105,5 +105,5 @@
 CLANG_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
 	-ffreestanding -fno-builtin -nostdlib -nostdinc \
-	-Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
+	-Wall -Werror -Wextra -Wno-unused-parameter -Wmissing-prototypes \
 	-Werror-implicit-function-declaration -Wwrite-strings \
 	-integrated-as \
Index: kernel/arch/arm32/src/mach/beaglebone/beaglebone.c
===================================================================
--- kernel/arch/arm32/src/mach/beaglebone/beaglebone.c	(revision 273c9760404837a4e66cf21f18aa616b1834bd9a)
+++ kernel/arch/arm32/src/mach/beaglebone/beaglebone.c	(revision f3386d746b4f2e3d741eb9009428dbd331e2b6b1)
@@ -177,5 +177,4 @@
 {
 	const unsigned inum = am335x_irc_inum_get(bbone.irc_addr);
-	am335x_irc_irq_ack(bbone.irc_addr);
 
 	irq_t *irq = irq_dispatch_and_lock(inum);
@@ -187,4 +186,6 @@
 		printf("Spurious interrupt\n");
 	}
+
+	am335x_irc_irq_ack(bbone.irc_addr);
 }
 
Index: kernel/genarch/src/drivers/am335x/timer.c
===================================================================
--- kernel/genarch/src/drivers/am335x/timer.c	(revision 273c9760404837a4e66cf21f18aa616b1834bd9a)
+++ kernel/genarch/src/drivers/am335x/timer.c	(revision f3386d746b4f2e3d741eb9009428dbd331e2b6b1)
@@ -119,7 +119,5 @@
 	/* Disable compare mode */
 	tclr &= ~AM335x_TIMER_TCLR_CE_FLAG;
-	/* Enable the prescaler, divisor = 2 */
-	tclr |= AM335x_TIMER_TCLR_PRE_FLAG;
-	tclr &= ~(AM335x_TIMER_TCLR_PTV_MASK << AM335x_TIMER_TCLR_PTV_SHIFT);
+
 	/* Enable auto-reload mode */
 	tclr |= AM335x_TIMER_TCLR_AR_FLAG;
Index: kernel/generic/include/cc.h
===================================================================
--- kernel/generic/include/cc.h	(revision f3386d746b4f2e3d741eb9009428dbd331e2b6b1)
+++ kernel/generic/include/cc.h	(revision f3386d746b4f2e3d741eb9009428dbd331e2b6b1)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2013 Vojtech Horky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup generic
+ * @{
+ */
+/** @file
+ * Macros related to used compiler (such as GCC-specific attributes).
+ */
+
+#ifndef KERN_CC_H_
+#define KERN_CC_H_
+
+#ifndef __clang__
+#define ATTRIBUTE_OPTIMIZE(opt) \
+	__attribute__ ((optimize(opt)))
+#else
+#define ATTRIBUTE_OPTIMIZE(opt)
+#endif
+
+
+#endif
+
+/** @}
+ */
Index: kernel/generic/include/lib/memfnc.h
===================================================================
--- kernel/generic/include/lib/memfnc.h	(revision 273c9760404837a4e66cf21f18aa616b1834bd9a)
+++ kernel/generic/include/lib/memfnc.h	(revision f3386d746b4f2e3d741eb9009428dbd331e2b6b1)
@@ -37,9 +37,10 @@
 
 #include <typedefs.h>
+#include <cc.h>
 
 extern void *memset(void *, int, size_t)
-    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
+    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns");
 extern void *memcpy(void *, const void *, size_t)
-    __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
+    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns");
 
 #endif
Index: kernel/test/print/print4.c
===================================================================
--- kernel/test/print/print4.c	(revision 273c9760404837a4e66cf21f18aa616b1834bd9a)
+++ kernel/test/print/print4.c	(revision f3386d746b4f2e3d741eb9009428dbd331e2b6b1)
@@ -36,5 +36,5 @@
 	uint8_t group;
 	for (group = 1; group < 4; group++) {
-		TPRINTF("%#" PRIx8 ": ", group << 5);
+		TPRINTF("%#x: ", group << 5);
 		
 		uint8_t index;
@@ -52,5 +52,5 @@
 	
 	for (group = 4; group < 8; group++) {
-		TPRINTF("%#" PRIx8 ": ", group << 5);
+		TPRINTF("%#x: ", group << 5);
 		
 		uint8_t index;
