diff --git a/Makefile b/Makefile
index 60fa79665ef149141063cd2c3ebcecc15bd54672..2a59058502c2dd1f45d421098356db10f5b8a249 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
 # Makefile for qosmngr
 include common.mk
 
+-include Makefile.diag.inc
+
 QOSMNGR_LIB=libqosmngr.so
 
 GCOV=gcov
@@ -11,7 +13,7 @@ PROG = $(PROJECT_TOPLEVEL)/qosmngr
 SHARED_LIB = $(PROJECT_TOPLEVEL)/libqosmngr.so
 OBJS = $(addprefix $(SRC_DIR)/, main.o qosmngr.o )
 
-PROG_CFLAGS = $(CFLAGS) -I$(INCLUDE_DIR) -Wall -fstrict-aliasing
+PROG_CFLAGS = $(CFLAGS) -I$(INCLUDE_DIR) $(DIAG_CFLAGS) -Werror -fstrict-aliasing
 PROG_LDFLAGS = $(LDFLAGS)
 PROG_LIBS = $(COMMON_LDFLAGS) -lgcov
 
diff --git a/Makefile.diag.inc b/Makefile.diag.inc
new file mode 100644
index 0000000000000000000000000000000000000000..7729cbb57a7b5c234dd42bd183b4298dcd8ab409
--- /dev/null
+++ b/Makefile.diag.inc
@@ -0,0 +1 @@
+DIAG_CFLAGS = -Wall -Wshadow -Wdouble-promotion -Wformat=2 -Wundef -fno-common -Wconversion -Wstrict-prototypes -Wno-declaration-after-statement