GNOME Bugzilla – Bug 659690
Possible build warning in code generated by gdbus-codegen
Last modified: 2011-09-21 12:19:41 UTC
Telepathy spec has a signal with an arg called "time". This generates this function: void tp_gdbus_debug_emit_new_debug_message ( TpGDBusDebug *object, gdouble time, const gchar *domain, guint level, const gchar *message) { g_signal_emit_by_name (object, "new-debug-message", time, domain, level, message); } Which makes build error: _gen/tp-gdbus.c: In function 'tp_gdbus_debug_emit_new_debug_message': _gen/tp-gdbus.c:72126:13: error: declaration of 'time' shadows a global declaration [-Werror=shadow] The current telepathy generator workaround this by prepending "arg_" to all function arg names.
Guess I could --annotate it, or change in the spec, if you consider it's not worth prefixing names in gdbus-codegen.
Good point. I guess it's fine to prepend - we already prepend OUT arguments with out_. Suggest we keep out_ for OUT arguments and prepend non-OUT arguments with arg_.
Created attachment 197147 [details] [review] gdbus-codegen: prepend arg_ to method/signal arg names This is to avoid shadow declaration warning in the case an arg name is "time" for example.
Looks good to me, passes the test suite and the various gdbus-codegen(1)-using projects of mine. I'm pushing it to master and also glib-2-30 since it's not something we want to miss (why I added Ryan to the Cc). Thanks!
Closing, thanks.