| From 558f7296559f43fa33cecfbab9d8832f56b1d514 Mon Sep 17 00:00:00 2001 |
| From: Ben Chan <benchan@chromium.org> |
| Date: Tue, 20 Jun 2017 19:15:32 -0700 |
| Subject: [PATCH] Annotate generated static inline functions with |
| __attribute__((unused)) |
| |
| clang may generate an unused-function warning on a function that is |
| marked 'static inline'. This patch annotates those static inline |
| functions generated by dbus-binding-tool with '__attribute__((unused))' |
| to suppress the warning. |
| --- |
| dbus/dbus-binding-tool-glib.c | 6 +++--- |
| 1 file changed, 3 insertions(+), 3 deletions(-) |
| |
| diff --git a/dbus/dbus-binding-tool-glib.c b/dbus/dbus-binding-tool-glib.c |
| index f0b6bf6..295d504 100644 |
| --- a/dbus/dbus-binding-tool-glib.c |
| +++ b/dbus/dbus-binding-tool-glib.c |
| @@ -1491,7 +1491,7 @@ write_async_method_client (GIOChannel *channel, InterfaceInfo *interface, Method |
| |
| |
| /* Write the main wrapper function */ |
| - WRITE_OR_LOSE ("static inline DBusGProxyCall*\n"); |
| + WRITE_OR_LOSE ("static inline __attribute__((unused)) DBusGProxyCall*\n"); |
| if (!write_printf_to_iochannel ("%s_async (DBusGProxy *proxy", channel, error, |
| method_name)) |
| goto io_lose; |
| @@ -1600,7 +1600,7 @@ generate_client_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error |
| } |
| |
| |
| - WRITE_OR_LOSE ("static inline gboolean\n"); |
| + WRITE_OR_LOSE ("static inline __attribute__((unused)) gboolean\n"); |
| if (!write_printf_to_iochannel ("%s (DBusGProxy *proxy", channel, error, |
| method_c_name)) |
| goto io_lose; |
| @@ -1685,7 +1685,7 @@ dbus_binding_tool_output_glib_client (BaseInfo *info, GIOChannel *channel, gbool |
| |
| WRITE_OR_LOSE ("#ifndef _DBUS_GLIB_ASYNC_DATA_FREE\n"); |
| WRITE_OR_LOSE ("#define _DBUS_GLIB_ASYNC_DATA_FREE\n"); |
| - WRITE_OR_LOSE ("static inline void\n"); |
| + WRITE_OR_LOSE ("static inline __attribute__((unused)) void\n"); |
| WRITE_OR_LOSE ("_dbus_glib_async_data_free (gpointer stuff)\n{\n\tg_slice_free (DBusGAsyncData, stuff);\n}\n"); |
| WRITE_OR_LOSE ("#endif\n\n"); |
| |
| -- |
| 2.13.1.611.g7e3b11ae1-goog |
| |