ao-tools: Add lots of compiler warning flags to ao-tools build
authorKeith Packard <keithp@keithp.com>
Thu, 3 Jan 2019 19:40:32 +0000 (11:40 -0800)
committerKeith Packard <keithp@keithp.com>
Thu, 3 Jan 2019 19:40:32 +0000 (11:40 -0800)
This catches some uninitialized variable errors which cause
ao-cal-accel to crash (fixes coming next)

Signed-off-by: Keith Packard <keithp@keithp.com>
31 files changed:
ao-tools/ao-bitbang/Makefile.am
ao-tools/ao-bm70/Makefile.am [new file with mode: 0644]
ao-tools/ao-boot-stm32/Makefile.am [new file with mode: 0644]
ao-tools/ao-cal-accel/Makefile.am
ao-tools/ao-cal-freq/Makefile.am
ao-tools/ao-chaosread/Makefile.am
ao-tools/ao-dbg/Makefile.am
ao-tools/ao-dump-up/Makefile.am
ao-tools/ao-dumpflash/Makefile.am
ao-tools/ao-dumplog/Makefile.am
ao-tools/ao-edit-telem/Makefile.am
ao-tools/ao-eeprom/Makefile.am
ao-tools/ao-elftohex/Makefile.am
ao-tools/ao-list/Makefile.am
ao-tools/ao-load/Makefile.am
ao-tools/ao-makebin/Makefile.am
ao-tools/ao-mega/Makefile.am
ao-tools/ao-postflight/Makefile.am
ao-tools/ao-rawload/Makefile.am
ao-tools/ao-send-telem/Makefile.am
ao-tools/ao-sky-flash/Makefile.am
ao-tools/ao-stmload/Makefile.am
ao-tools/ao-telem/Makefile.am
ao-tools/ao-test-baro/Makefile.am
ao-tools/ao-test-flash/Makefile.am
ao-tools/ao-test-gps/Makefile.am
ao-tools/ao-test-igniter/Makefile.am
ao-tools/ao-usbload/Makefile.am
ao-tools/ao-usbtrng/Makefile.am
ao-tools/ao-view/Makefile.am
configure.ac

index f01cddd..b42885a 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-bitbang
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_BITBANG_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_bitbang_DEPENDENCIES = $(AO_BITBANG_LIBS)
diff --git a/ao-tools/ao-bm70/Makefile.am b/ao-tools/ao-bm70/Makefile.am
new file mode 100644 (file)
index 0000000..f13ce0f
--- /dev/null
@@ -0,0 +1,7 @@
+bin_PROGRAMS=ao-bm70
+
+AM_CFLAGS=-O0 -g
+
+ao_bm70_SOURCES = ao-bm70.c
+
+man_MANS=ao-bm70.1
diff --git a/ao-tools/ao-boot-stm32/Makefile.am b/ao-tools/ao-boot-stm32/Makefile.am
new file mode 100644 (file)
index 0000000..581eb2d
--- /dev/null
@@ -0,0 +1,9 @@
+bin_PROGRAMS=ao-chaosread
+
+AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+
+ao_chaosread_LDADD=$(LIBUSB_LIBS)
+
+ao_chaosread_SOURCES = ao-chaosread.c
+
+man_MANS = ao-chaosread.1
index d278097..4999725 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-cal-accel
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 
 ao_cal_accel_DEPENDENCIES = $(top_builddir)/ao-tools/lib/libao-tools.a
 
index e11c2b0..eccfde2 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-cal-freq
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 
 ao_cal_freq_DEPENDENCIES = $(top_builddir)/ao-tools/lib/libao-tools.a
 
index 6ba8885..d2bf0e9 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-chaosread
 
-AM_CFLAGS=$(LIBUSB_CFLAGS) -Wall -Wextra
+AM_CFLAGS=$(WARN_CFLAGS) $(LIBUSB_CFLAGS) -Wall -Wextra
 
 ao_chaosread_LDADD=$(LIBUSB_LIBS)
 
index 2c33cf0..e2fe654 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-dbg
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_DBG_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 man_MANS = ao-dbg.1
index 94bb94a..a5395a4 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-dump-up
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS) $(GNOME_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS) $(GNOME_CFLAGS)
 AO_DUMP_LOG_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_dump_up_DEPENDENCIES = $(AO_DUMP_LOG_LIBS)
index db99f5a..2b134f9 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-dumpflash
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_DUMPLOG_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_dumpflash_DEPENDENCIES = $(AO_DUMPLOG_LIBS)
index a80cac3..bd4a870 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-dumplog
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS) $(GNOME_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS) $(GNOME_CFLAGS)
 AO_DUMPLOG_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_dumplog_DEPENDENCIES = $(AO_DUMPLOG_LIBS)
index c5965c4..154d639 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-edit-telem
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_POSTFLIGHT_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_edit_telem_DEPENDENCIES = $(AO_POSTFLIGHT_LIBS)
index efeed97..6c5e038 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-eeprom
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_EEPROM_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_eeprom_DEPENDENCIES = $(AO_EEPROM_LIBS)
index dd0046d..5e1975e 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-elftohex
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_ELFTOHEX_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_elftohex_DEPENDENCIES = $(AO_ELFTOHEX_LIBS)
index de3c4de..a3fbfa8 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-list
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_LIST_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_list_DEPENDENCIES = $(AO_LIST_LIBS)
index 3c48dc2..b92a9c8 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-load
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_LOAD_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_load_DEPENDENCIES = $(AO_LOAD_LIBS)
index 758097a..0946fb2 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-makebin
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_ELFTOHEX_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_makebin_DEPENDENCIES = $(AO_ELFTOHEX_LIBS)
index 22b6260..1a221b6 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-mega
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_POSTFLIGHT_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_mega_DEPENDENCIES = $(AO_POSTFLIGHT_LIBS)
index 589d164..892c62c 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-postflight
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS) $(GNOME_CFLAGS) $(PLPLOT_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS) $(GNOME_CFLAGS) $(PLPLOT_CFLAGS)
 AO_POSTFLIGHT_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_postflight_DEPENDENCIES = $(AO_POSTFLIGHT_LIBS)
index d2c5565..6488054 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-rawload
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_RAWLOAD_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_rawload_DEPENDENCIES = $(AO_RAWLOAD_LIBS)
index bfddf13..227e714 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-send-telem
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_POSTFLIGHT_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_send_telem_DEPENDENCIES = $(AO_POSTFLIGHT_LIBS)
index f6c5089..9e3f2c1 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-sky-flash
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_SKY_FLASH_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_sky_flash_DEPENDENCIES = $(AO_SKY_FLASH_LIBS)
index 45eb621..a049f27 100644 (file)
@@ -2,7 +2,7 @@ if LIBSTLINK
 
 bin_PROGRAMS=ao-stmload
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(STLINK_CFLAGS) $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(STLINK_CFLAGS) $(LIBUSB_CFLAGS)
 AO_STMLOAD_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_stmload_DEPENDENCIES = $(AO_STMLOAD_LIBS)
index 3436443..8cc05ce 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-telem
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_POSTFLIGHT_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_telem_DEPENDENCIES = $(AO_POSTFLIGHT_LIBS)
index 69e4752..c4d8cf2 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-test-baro
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 
 ao_test_baro_DEPENDENCIES = $(top_builddir)/ao-tools/lib/libao-tools.a
 
index 0323c28..e01c7a6 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-test-flash
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 
 ao_test_flash_DEPENDENCIES = $(top_builddir)/ao-tools/lib/libao-tools.a
 
index d89dddd..db28891 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-test-gps
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 
 ao_test_gps_DEPENDENCIES = $(top_builddir)/ao-tools/lib/libao-tools.a
 
index e24ed46..6c9efdd 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-test-igniter
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 
 ao_test_igniter_DEPENDENCIES = $(top_builddir)/ao-tools/lib/libao-tools.a
 
index e3b63a8..9a05d5c 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-usbload
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 AO_STMLOAD_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
 
 ao_usbload_DEPENDENCIES = $(AO_STMLOAD_LIBS)
index 5cbab5c..14113a8 100644 (file)
@@ -1,6 +1,6 @@
 bin_PROGRAMS=ao-usbtrng
 
-AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
+AM_CFLAGS=$(WARN_CFLAGS) -I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS)
 
 ao_usbtrng_DEPENDENCIES = $(top_builddir)/ao-tools/lib/libao-tools.a
 
index 7a28841..3cdf1dd 100644 (file)
@@ -2,7 +2,7 @@ VERSION=$(shell git describe)
 
 AO_VIEW_CFLAGS=-I$(top_srcdir)/ao-tools/lib
 AO_VIEW_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a
-AM_CFLAGS=$(AO_VIEW_CFLAGS) $(GNOME_CFLAGS) $(ALSA_CFLAGS) -I$(top_srcdir)/src -DAOVIEW_VERSION=\"$(VERSION)\" @FLITE_INCS@
+AM_CFLAGS=$(WARN_CFLAGS) $(AO_VIEW_CFLAGS) $(GNOME_CFLAGS) $(ALSA_CFLAGS) -I$(top_srcdir)/src -DAOVIEW_VERSION=\"$(VERSION)\" @FLITE_INCS@
 
 bin_PROGRAMS=ao-view
 
index abaec2c..32fcea3 100644 (file)
@@ -184,6 +184,9 @@ else
        HAVE_GOOGLE_KEY="no"
 fi
 
+WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
+AC_SUBST(WARN_CFLAGS)
+
 AC_ARG_ENABLE(faketime, AS_HELP_STRING([--enable-faketime],
               [Use faketime program to ensure pdf files are reproducible (default=no)]),
              [FAKETIME=$enableval], [FAKETIME=no])