aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-02-18 22:36:52 +0100
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-02-18 22:36:52 +0100
commit656aeddec6f90d965e2c1d91eb5a9abc8e4723c1 (patch)
treeca63cfbac7037c939f3a4f5cef6211459605f347
parent57d7a4588f4031c08cf3d4318a61e9c677a19915 (diff)
downloadsynthpod-656aeddec6f90d965e2c1d91eb5a9abc8e4723c1.zip
synthpod-656aeddec6f90d965e2c1d91eb5a9abc8e4723c1.tar.gz
synthpod-656aeddec6f90d965e2c1d91eb5a9abc8e4723c1.tar.bz2
synthpod-656aeddec6f90d965e2c1d91eb5a9abc8e4723c1.tar.xz
Add format attribute for compiler checks.
-rw-r--r--CMakeLists.txt2
-rw-r--r--VERSION2
-rw-r--r--app/synthpod_app_mod.c6
-rw-r--r--app/synthpod_app_private.h11
-rw-r--r--bin/synthpod_bin.c2
-rw-r--r--bin/synthpod_bin.h8
-rw-r--r--plugins/synthpod_common_nk.c8
-rw-r--r--sandbox_ui.lv2/sandbox_slave.c2
8 files changed, 19 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 61bfad3..ad75ea3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,7 +70,7 @@ add_definitions("-DSYNTHPOD_MINOR_VERSION=${SYNTHPOD_MINOR_VERSION}")
add_definitions("-DSYNTHPOD_MICRO_VERSION=${SYNTHPOD_MICRO_VERSION}")
add_definitions("-DSYNTHPOD_VERSION=\"${SYNTHPOD_VERSION}\"")
-set(CMAKE_C_FLAGS "-std=gnu11 -Wextra -Wno-unused-parameter -Wno-attributes -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}")
+set(CMAKE_C_FLAGS "-std=gnu11 -Wextra -Wformat -Wno-unused-parameter -Wno-attributes -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "-Wshadow -Wimplicit-function-declaration -Wmissing-prototypes -Wstrict-prototypes ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-std=gnu++11 -Wextra -ffast-math -fvisibility=hidden ${CMAKE_CXX_FLAGS}")
diff --git a/VERSION b/VERSION
index bc6c2b2..272171b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5553
+0.1.5555
diff --git a/app/synthpod_app_mod.c b/app/synthpod_app_mod.c
index 97859c3..22ca074 100644
--- a/app/synthpod_app_mod.c
+++ b/app/synthpod_app_mod.c
@@ -88,7 +88,7 @@ _log_vprintf(LV2_Log_Handle handle, LV2_URID type, const char *fmt, va_list args
}
//FIXME is actually __realtime
-__non_realtime static int
+__non_realtime static int __attribute__((format(printf, 3, 4)))
_log_printf(LV2_Log_Handle handle, LV2_URID type, const char *fmt, ...)
{
va_list args;
@@ -343,8 +343,8 @@ _sp_app_mod_features_populate(sp_app_t *app, mod_t *mod)
return nfeatures;
}
-const LilvPlugin *
-_sp_app_mod_is_supported(sp_app_t *app, const void *uri)
+static const LilvPlugin *
+_sp_app_mod_is_supported(sp_app_t *app, const char *uri)
{
LilvNode *uri_node = lilv_new_uri(app->world, uri);
if(!uri_node)
diff --git a/app/synthpod_app_private.h b/app/synthpod_app_private.h
index 306b9a0..2cb0374 100644
--- a/app/synthpod_app_private.h
+++ b/app/synthpod_app_private.h
@@ -504,16 +504,16 @@ extern const port_driver_t seq_port_driver;
/*
* Debug
*/
-int
+int __attribute__((format(printf, 2, 3)))
sp_app_log_error(sp_app_t *app, const char *fmt, ...);
-int
+int __attribute__((format(printf, 2, 3)))
sp_app_log_note(sp_app_t *app, const char *fmt, ...);
-int
+int __attribute__((format(printf, 2, 3)))
sp_app_log_warning(sp_app_t *app, const char *fmt, ...);
-int
+int __attribute__((format(printf, 2, 3)))
sp_app_log_trace(sp_app_t *app, const char *fmt, ...);
/*
@@ -642,9 +642,6 @@ _sp_app_state_bundle_load(sp_app_t *app, const char *bundle_path);
/*
* Mod
*/
-const LilvPlugin *
-_sp_app_mod_is_supported(sp_app_t *app, const void *uri);
-
mod_t *
_sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn);
diff --git a/bin/synthpod_bin.c b/bin/synthpod_bin.c
index 611b12a..34c223a 100644
--- a/bin/synthpod_bin.c
+++ b/bin/synthpod_bin.c
@@ -233,7 +233,7 @@ _log_vprintf(void *data, LV2_URID type, const char *fmt, va_list args)
return 0;
}
-__non_realtime static int
+__non_realtime static int __attribute__((format(printf, 3, 4)))
_log_printf(void *data, LV2_URID type, const char *fmt, ...)
{
va_list args;
diff --git a/bin/synthpod_bin.h b/bin/synthpod_bin.h
index 7bc7a36..b5e1bab 100644
--- a/bin/synthpod_bin.h
+++ b/bin/synthpod_bin.h
@@ -152,16 +152,16 @@ bin_bundle_save(bin_t *bin, const char *bundle_path);
void
bin_quit(bin_t *bin);
-int
+int __attribute__((format(printf, 2, 3)))
bin_log_error(bin_t *bin, const char *fmt, ...);
-int
+int __attribute__((format(printf, 2, 3)))
bin_log_note(bin_t *bin, const char *fmt, ...);
-int
+int __attribute__((format(printf, 2, 3)))
bin_log_warning(bin_t *bin, const char *fmt, ...);
-int
+int __attribute__((format(printf, 2, 3)))
bin_log_trace(bin_t *bin, const char *fmt, ...);
int
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index 522c242..8378e43 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -558,7 +558,7 @@ _log_vprintf(plughandle_t *handle, LV2_URID typ, const char *fmt, va_list args)
: vfprintf(stderr, fmt, args);
}
-static int
+static int __attribute__((format(printf, 2, 3)))
_log_error(plughandle_t *handle, const char *fmt, ...)
{
va_list args;
@@ -571,7 +571,7 @@ _log_error(plughandle_t *handle, const char *fmt, ...)
return ret;
}
-static int
+static int __attribute__((format(printf, 2, 3)))
_log_note(plughandle_t *handle, const char *fmt, ...)
{
va_list args;
@@ -584,7 +584,7 @@ _log_note(plughandle_t *handle, const char *fmt, ...)
return ret;
}
-static int
+static int __attribute__((format(printf, 2, 3)))
_log_warning(plughandle_t *handle, const char *fmt, ...)
{
va_list args;
@@ -597,7 +597,7 @@ _log_warning(plughandle_t *handle, const char *fmt, ...)
return ret;
}
-static int
+static int __attribute__((format(printf, 2, 3)))
_log_trace(plughandle_t *handle, const char *fmt, ...)
{
va_list args;
diff --git a/sandbox_ui.lv2/sandbox_slave.c b/sandbox_ui.lv2/sandbox_slave.c
index 68a3ea5..74144a8 100644
--- a/sandbox_ui.lv2/sandbox_slave.c
+++ b/sandbox_ui.lv2/sandbox_slave.c
@@ -172,7 +172,7 @@ _log_vprintf(LV2_Log_Handle handle, LV2_URID type, const char *fmt, va_list args
return 0;
}
-static inline int
+static inline int __attribute__((format(printf, 3, 4)))
_log_printf(LV2_Log_Handle handle, LV2_URID type, const char *fmt, ...)
{
va_list args;