GNOME Bugzilla – Bug 586107
gtkprintbackendpapi.c does not compile on Solaris 10
Last modified: 2013-10-06 05:27:38 UTC
Compiling gtk+ 2.16.2 on Solaris 10 with GCC 3.4.6 (from within pkgsrc) fails with gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../gtk -I../../../gdk -DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED -D_REENTRANT -D_PTHREADS -D _POSIX_PTHREAD_SEMANTICS -I/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/.buildlink/include/glib/glib-2.0 -I/software/pkgsrc /source/pkgsrc/x11/gtk2/work.spare280/.buildlink/lib/glib-2.0/include -I/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/.build link/include/pango-1.0 -I/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/.buildlink/include/cairo -I/software/pkgsrc/source/pk gsrc/x11/gtk2/work.spare280/.buildlink/include/pixman-1 -I/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/.buildlink/include/f reetype2 -I/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/.buildlink/include -I/software/pkgsrc/source/pkgsrc/x11/gtk2/work.s pare280/.buildlink/include/libpng12 -I/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/.buildlink/include/atk-1.0 -DG_DISABLE_C AST_CHECKS -DPREFIX=\"/usr/pkgsrc/20090421\" -DPNG_NO_ASSEMBLER_CODE -I/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/.buildl ink/include/python2.5 -I/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/.buildlink/include/db4 -I/software/pkgsrc/source/pkgsr c/x11/gtk2/work.spare280/.buildlink/gcc34/include -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SIN GLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_DEPRECATED -O -Wall -MT gtkprintbackendpapi.lo -MD -MP -MF .deps/gtk printbackendpapi.Tpo -c gtkprintbackendpapi.c -fPIC -DPIC -o .libs/gtkprintbackendpapi.o In file included from gtkprintbackendpapi.c:31: ../../../config.h:273:1: warning: "_FILE_OFFSET_BITS" redefined In file included from /usr/include/unistd.h:18, from gtkprintbackendpapi.c:23: /usr/include/sys/feature_tests.h:188:1: warning: this is the location of the previous definition gtkprintbackendpapi.c: In function `gtk_print_backend_papi_print_stream': gtkprintbackendpapi.c:354: error: incompatible types in initialization gtkprintbackendpapi.c:344: warning: unused variable `print_error' gtkprintbackendpapi.c:348: warning: unused variable `argc' gtkprintbackendpapi.c:349: warning: unused variable `in_fd' gtkprintbackendpapi.c:350: warning: unused variable `argv' gtkprintbackendpapi.c: In function `papi_get_printer_list': gtkprintbackendpapi.c:580: warning: unused variable `name' gtkprintbackendpapi.c:580: warning: unused variable `url' gtkprintbackendpapi.c:581: warning: unused variable `attrs' gtkprintbackendpapi.c:548: warning: unused variable `attributes' gtkprintbackendpapi.c:554: warning: unused variable `status2' gtkprintbackendpapi.c:557: warning: unused variable `printer' gtkprintbackendpapi.c:559: warning: unused variable `current_printer_list' gtkprintbackendpapi.c: In function `update_printer_status': gtkprintbackendpapi.c:646: warning: unused variable `status_changed' gtkprintbackendpapi.c: In function `papi_printer_get_options': gtkprintbackendpapi.c:666: warning: unused variable `i' gtkprintbackendpapi.c: In function `papi_printer_prepare_for_print': gtkprintbackendpapi.c:745: warning: assignment discards qualifiers from pointer target type gtkprintbackendpapi.c: In function `merge_ppd_data': gtkprintbackendpapi.c:771: warning: implicit declaration of function `get_ppd_attrs' gtkprintbackendpapi.c: In function `papi_display_printer_status': gtkprintbackendpapi.c:794: warning: unused variable `printer_uri' gtkprintbackendpapi.c:794: warning: unused variable `ppdfile' gtkprintbackendpapi.c:799: warning: unused variable `count' gmake[4]: *** [gtkprintbackendpapi.lo] Error 1 gmake[4]: Leaving directory `/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/gtk+-2.16.2/modules/printbackends/papi' gmake[3]: *** [all-recursive] Error 1 gmake[3]: Leaving directory `/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/gtk+-2.16.2/modules/printbackends' gmake[2]: *** [all-recursive] Error 1 gmake[2]: Leaving directory `/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/gtk+-2.16.2/modules' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/software/pkgsrc/source/pkgsrc/x11/gtk2/work.spare280/gtk+-2.16.2' gmake: *** [all] Error 2 *** Error code 2 Configuring with "--disable-papi" yields a working library, without PAPI support, though.
Ghee, can you look at this ?
Ok. Taking a look atm.
Jorn, What version of Solaris 10, do you have? cat /etc/release I tried gcc and build fine on Solaris nevada (which is Solaris after Solaris 10) gcc --version gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802) I am wondering whether this is a gcc differences or libpapi differences. I checked the papi package, SUNWpapi, it is in Solaris 10. Can you give me, pkginfo -l SUNWpapi Thanks, -Ghee P.S. Have not tried to compile these code on Solaris 10 since it is not one configuration we support.
Okay. There is a problem with that line: 354 papi_status_t pstatus = NULL; papi_status_t is enum, so should be initialized to NULL. I will make the change and clean up whole punch of unused variables. Since like all these inconsistencies are icked up by GCC 3.4.6, but bit 3.4.3.
Created attachment 137324 [details] [review] patch to fix this compiler problem
Matthias, please see patch attached. If you are okay, I will commit. Thanks.
For the record: I get the same error both on Solaris 10 (Solaris 10 10/08 s10x_u6wos_07b X86) and OpenSolaris (OpenSolaris 2009.06 snv_111b X86). The patch allows me to compile GTK, but I can't test the functionality of this printing backend.
(In reply to comment #7) > For the record: I get the same error both on Solaris 10 (Solaris 10 10/08 > s10x_u6wos_07b X86) and OpenSolaris (OpenSolaris 2009.06 snv_111b X86). > > The patch allows me to compile GTK, but I can't test the functionality of this > printing backend. Do you mean you can't test on Solaris 10 or both? I don't think you can test much of these on Solaris 10, since most of the application on Solaris 10 uses libgnomeprint backend not GTK+ print backend. The version of GNOME in Solaris 10 is GNOME 2.6. There is no reason for you to compile for OpenSolaris 2009.06 though since it already have both print backend for CUPS and PAPI. Matthias, any comment on the patch? Thanks >
Created attachment 256424 [details] [review] Fix Solaris build issue I have created an update patch and broken it into three parts
Created attachment 256425 [details] [review] Remove unused variables
Created attachment 256426 [details] [review] Remove unused function
Review of attachment 256424 [details] [review]: ok
Review of attachment 256425 [details] [review]: sure
Review of attachment 256426 [details] [review]: ok
Attachment 256426 [details] pushed as c759cb7 - Remove unused function