GNOME Bugzilla – Bug 773879
scangobj: Do not generate unused parameters
Last modified: 2017-11-01 20:09:11 UTC
argc and argv are unused in generated main function Signed-off-by: Pavel Grunt <pgrunt@redhat.com>
Created attachment 339013 [details] [review] scangobj: Do not generate unused parameters
Good point.
Review of attachment 339013 [details] [review]: ::: gtkdoc-scangobj.in @@ +244,2 @@ { $TYPE_INIT_FUNC; Unfortunately we can't do this as simple as this. Users can e.g. do SCANGOBJ_OPTIONS=--type-init-func="gst_init(&argc,&argv)" in the code we'll need to check if $TYPE_INIT_FUNC contains argc/argv.
Ping?
Created attachment 362476 [details] [review] scangobj: Avoid generating unused params The main function params may be unused depending on type init function definition. That may lead to generating a warning about unused in a project using gtk-doc, eg: DOC Scanning header files DOC Introspecting gobjects spice-gtk-scan.c: In function ‘main’: spice-gtk-scan.c:126:11: warning: unused parameter ‘argc’ [-Wunused-parameter] main (int argc, char *argv[]) ^~~~ spice-gtk-scan.c:126:23: warning: unused parameter ‘argv’ [-Wunused-parameter] main (int argc, char *argv[]) Check for the presence of argc and argv in the type init function and generate main function params accordingly
The following fix has been pushed: e39e5f8 scangobj: Avoid generating unused params
Created attachment 362781 [details] [review] scangobj: Avoid generating unused params The main function params may be unused depending on type init function definition. That may lead to generating a warning about unused in a project using gtk-doc, eg: DOC Scanning header files DOC Introspecting gobjects spice-gtk-scan.c: In function ‘main’: spice-gtk-scan.c:126:11: warning: unused parameter ‘argc’ [-Wunused-parameter] main (int argc, char *argv[]) ^~~~ spice-gtk-scan.c:126:23: warning: unused parameter ‘argv’ [-Wunused-parameter] main (int argc, char *argv[]) Check for the presence of argc and argv in the type init function and generate main function params accordingly
Thanks!