GNOME Bugzilla – Bug 773133
Pygobject build fails due to unused variable in gobject-introspection/tests/gimmarshallingtests.c
Last modified: 2018-02-08 12:43:42 UTC
make[2]: Entering directory '/home/ferbncode/.cache/jhbuild/build/pygobject/tests' CC libgimarshallingtests_la-gimarshallingtests.lo test -L libregress.so || ln -s .libs/libregress.so libregress.so test -L testhelper.so || ln -s .libs/testhelper.so testhelper.so /home/ferbncode/jhbuild/install/share/gobject-introspection-1.0/tests/gimarshallingtests.c: In function ‘gi_marshalling_tests_array_bool_out’: /home/ferbncode/jhbuild/install/share/gobject-introspection-1.0/tests/gimarshallingtests.c:1594:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] *bools = values; ^ /home/ferbncode/jhbuild/install/share/gobject-introspection-1.0/tests/gimarshallingtests.c: In function ‘gi_marshalling_tests_array_unichar_out’: /home/ferbncode/jhbuild/install/share/gobject-introspection-1.0/tests/gimarshallingtests.c:1606:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] *chars = values; ^ /home/ferbncode/jhbuild/install/share/gobject-introspection-1.0/tests/gimarshallingtests.c: In function ‘gi_marshalling_tests_array_zero_terminated_return_unichar’: /home/ferbncode/jhbuild/install/share/gobject-introspection-1.0/tests/gimarshallingtests.c:1725:12: error: unused variable ‘ix’ [-Werror=unused-variable] unsigned ix; ^~ cc1: some warnings being treated as errors make[2]: *** [Makefile:553: libgimarshallingtests_la-gimarshallingtests.lo] Error 1 make[2]: Leaving directory '/home/ferbncode/.cache/jhbuild/build/pygobject/tests' make[1]: *** [Makefile:676: all-recursive] Error 1 make[1]: Leaving directory '/home/ferbncode/.cache/jhbuild/build/pygobject' make: *** [Makefile:499: all] Error 2 *** Error during phase build of pygobject: ########## Error running make -j 3 *** [59/60]
Created attachment 337919 [details] [review] tests/gimmarshallingtests.c: Unused variable x1 in gi_marshalling_tests_array_zero_terminated_return_unichar function In building pygobject from jhbuild, the make failed due to an unused variable x1 in the gi_marshalling_test_array_zero_terminated_return_unichar function at line 1725 in the tests/gimarshallingtests.c. To fix the issue, the declaration of the variable was removed from the tests/gimarshallingtests.c file at line 1725. The build of both pygobject and gobject_introspection were successful after the change.
Review of attachment 337919 [details] [review]: Needs work. ::: tests/gimarshallingtests.c @@ +1723,3 @@ { static const gunichar value[] = GI_MARSHALLING_TESTS_CONSTANT_UCS4; + /*unsigned ix;*/ Instead of commenting unused code, simply remove it.
Created attachment 337936 [details] [review] tests/gimmarshallingtests.c: Unused variable x1 in gi_marshalling_tests_array_zero_terminated_return_unichar function In building pygobject from jhbuild, the make failed due to an unused variable x1 in the gi_marshalling_test_array_zero_terminated_return_unichar function at line 1725 in the tests/gimarshallingtests.c. To fix the issue, the code doing the declaration of the variable was removed from the tests/gimarshallingtests.c file at line 1725.
fyi, pygobject master no longer passes any warnings flags when building gimarshallingtests
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/165.