After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773879 - scangobj: Do not generate unused parameters
scangobj: Do not generate unused parameters
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: 1.27
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-03 08:27 UTC by Pavel Grunt
Modified: 2017-11-01 20:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scangobj: Do not generate unused parameters (772 bytes, patch)
2016-11-03 08:27 UTC, Pavel Grunt
none Details | Review
scangobj: Avoid generating unused params (2.05 KB, patch)
2017-10-29 09:19 UTC, Pavel Grunt
committed Details | Review
scangobj: Avoid generating unused params (2.07 KB, patch)
2017-11-01 20:08 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Pavel Grunt 2016-11-03 08:27:39 UTC
argc and argv are unused in generated main function

Signed-off-by: Pavel Grunt <pgrunt@redhat.com>
Comment 1 Pavel Grunt 2016-11-03 08:27:42 UTC
Created attachment 339013 [details] [review]
scangobj: Do not generate unused parameters
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2016-11-26 21:12:38 UTC
Good point.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2016-11-26 21:16:59 UTC
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.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2017-10-25 18:00:37 UTC
Ping?
Comment 5 Pavel Grunt 2017-10-29 09:19:22 UTC
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
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2017-11-01 20:08:08 UTC
The following fix has been pushed:
e39e5f8 scangobj: Avoid generating unused params
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2017-11-01 20:08:15 UTC
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
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2017-11-01 20:09:11 UTC
Thanks!