added sparse test
authorAndrew Tridgell <tridge@samba.org>
Sun, 13 Mar 2011 23:24:36 +0000 (10:24 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sun, 13 Mar 2011 23:24:36 +0000 (10:24 +1100)
nttime/Makefile
nttime/nttime_test.c

index cd73438..d967993 100644 (file)
@@ -1,7 +1,11 @@
-CFLAGS=-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes -Wconversion
+CFLAGS=-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes -Wconversion 
+GCCBASE=/usr/lib/gcc/x86_64-linux-gnu/4.4.5
 
-all: nttime_test.o
+all: nttime_test.o sparse_test.o
 
 clean:
        rm -f *.o *~
 
+.c.o:
+       sparse -Wbitwise -gcc-base-dir $(GCCBASE) $<
+       gcc $(CFLAGS) -c $<
index 163a7cc..9fc9b7a 100644 (file)
@@ -4,6 +4,7 @@
 #include <sys/time.h>
 
 typedef uint64_t NTTIME;
+
 typedef struct {
        uint64_t t;
 } NTTIME_s;