Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtkdialog does not build with gcc-14 #160

Closed
peabee opened this issue Apr 16, 2024 · 16 comments
Closed

gtkdialog does not build with gcc-14 #160

peabee opened this issue Apr 16, 2024 · 16 comments

Comments

@peabee
Copy link
Contributor

peabee commented Apr 16, 2024

Tried building gtkdialog with gcc-14 for NoblePup32 and got:

printing.c: In function 'pip_message_print_debug':
printing.c:53:9: error: implicit declaration of function 'g_vprintf'; did you mean 'g_print'? [-Wimplicit-function-declaration]
   53 |         g_vprintf(format, args);
      |         ^~~~~~~~~
      |         g_print
make[2]: *** [Makefile:549: printing.o] Error 1
make[2]: *** Waiting for unfinished jobs....

builds OK with gcc-12 (and I think gcc-13)

@dimkr
Copy link
Contributor

dimkr commented Apr 16, 2024

g_vprintf() is a glib function and it's present in my dpup (Debian testing, glib 2.78). lunar has 2.76, so it should have it too.

@peabee
Copy link
Contributor Author

peabee commented Apr 17, 2024

This was Noble which has glib 2.80

? printing.c needs:
#include <glib/gprintf.h>
?
but conditionally?

https://packages.ubuntu.com/hu/noble/i386/libglib2.0-dev/filelist

gprintf.h contains:
GLIB_AVAILABLE_IN_ALL
gint g_vprintf (gchar const *format,
va_list args) G_GNUC_PRINTF(1, 0);

@dimkr
Copy link
Contributor

dimkr commented Apr 17, 2024

glib 2.70 (2021?) docs say:

glib/gprintf.h must be explicitly included in order to use this function.

If it's been this way for at least 3 years, it needs to be mandatory and not conditional.

(The Wayback Machine doesn't have older copies of the glib API docs)

@peabee
Copy link
Contributor Author

peabee commented Apr 17, 2024

Searching for gprintf.h within the gtkdialog code base shows that it is not included anywhere.

It should be added to printing.h I assume?

@dimkr
Copy link
Contributor

dimkr commented Apr 17, 2024

I'd do this in printing.c, it's the only file that uses g_vprintf().

peabee added a commit that referenced this issue Apr 17, 2024
Needed to provide g_vprintf
see #160
@peabee
Copy link
Contributor Author

peabee commented Apr 17, 2024

Made the update - but although a build was actioned it doesn't seem to have resulted in a new release.....

@dimkr
Copy link
Contributor

dimkr commented Apr 17, 2024

build.yml only builds, it doesn't create a tag on success.

@step-
Copy link
Collaborator

step- commented Apr 17, 2024

And for a new release generally bump the version number in

AC_INIT([gtkdialog], [0.8.5], [thunorsif@hotmail.com], [gtkdialog],
.

@peabee
Copy link
Contributor Author

peabee commented Apr 17, 2024

Made release 0.8.5d

@peabee
Copy link
Contributor Author

peabee commented Apr 18, 2024

Sadly.... still failing to build gtkdialog with gcc-14:

gtkdialog.c: In function 'main':
gtkdialog.c:557:9: warning: 'g_thread_init' is deprecated [-Wdeprecated-declarations]
  557 |         g_thread_init (NULL);
      |         ^~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib.h:115:
/usr/include/glib-2.0/glib/deprecated/gthread.h:271:10: note: declared here
  271 | void     g_thread_init                   (gpointer vtable);
      |          ^~~~~~~~~~~~~
gtkdialog.c:631:17: error: implicit declaration of function 'run_program_by_glade' [-Wimplicit-function-declaration]
  631 |                 run_program_by_glade(option_glade_file, option_input_variable);
      |                 ^~~~~~~~~~~~~~~~~~~~
In file included from macros.h:26,
                 from gtkdialog.c:52:
printing.h: At top level:
printing.h:55:1: warning: inline function 'pip_message_print_warning' declared but never defined
   55 | pip_message_print_warning(
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
printing.h:49:1: warning: inline function 'pip_message_print_debug' declared but never defined
   49 | pip_message_print_debug(
      | ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/gtk-2.0/gtk/gtkobject.h:37,
                 from /usr/include/gtk-2.0/gtk/gtkwidget.h:36,
                 from /usr/include/gtk-2.0/gtk/gtkcontainer.h:35,
                 from /usr/include/gtk-2.0/gtk/gtkbin.h:35,
                 from /usr/include/gtk-2.0/gtk/gtkwindow.h:36,
                 from /usr/include/gtk-2.0/gtk/gtkdialog.h:35,
                 from /usr/include/gtk-2.0/gtk/gtkaboutdialog.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:33,
                 from gtkdialog.h:30,
                 from variables.c:23:
/usr/include/gtk-2.0/gtk/gtktypeutils.h:236:1: warning: 'GTypeDebugFlags' is deprecated [-Wdeprecated-declarations]
  236 | void            gtk_type_init   (GTypeDebugFlags    debug_flags);
      | ^~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
                 from /usr/include/glib-2.0/gobject/gbinding.h:31,
                 from /usr/include/glib-2.0/glib-object.h:24,
                 from /usr/include/glib-2.0/gio/gioenums.h:30,
                 from /usr/include/glib-2.0/gio/giotypes.h:30,
                 from /usr/include/glib-2.0/gio/gio.h:28,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32:
/usr/include/glib-2.0/gobject/gtype.h:725:1: note: declared here
  725 | {
      | ^
In file included from /usr/include/gtk-2.0/gtk/gtktoolitem.h:31,
                 from /usr/include/gtk-2.0/gtk/gtktoolbutton.h:30,
                 from /usr/include/gtk-2.0/gtk/gtkmenutoolbutton.h:30,
                 from /usr/include/gtk-2.0/gtk/gtk.h:126:
/usr/include/gtk-2.0/gtk/gtktooltips.h:73:3: warning: 'GTimeVal' is deprecated: Use 'GDateTime' instead [-Wdeprecated-declarations]
   73 |   GTimeVal last_popdown;
      |   ^~~~~~~~
In file included from /usr/include/glib-2.0/glib/galloca.h:34,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/glib-2.0/gobject/gbinding.h:30:
/usr/include/glib-2.0/glib/gtypes.h:580:8: note: declared here
  580 | struct _GTimeVal
      |        ^~~~~~~~~
variables.c: In function 'variables_set_value':
variables.c:472:25: error: implicit declaration of function 'yywarning'; did you mean 'g_warning'? [-Wimplicit-function-declaration]
  472 |                         yywarning("Set-value not implemented for this widget.");
      |                         ^~~~~~~~~
      |                         g_warning
variables.c: In function 'do_variables_count_widgets':
variables.c:1122:17: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
 1122 |                 return;
      |                 ^~~~~~
variables.c:1116:13: note: declared here
 1116 | static gint do_variables_count_widgets(variable *actual, gint n)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:549: gtkdialog.o] Error 1
make[2]: *** Waiting for unfinished jobs....

@step-
Copy link
Collaborator

step- commented Apr 18, 2024

I think variables.c:1122 should be return n; not return;. The function needs to return an integer value.

@step-
Copy link
Collaborator

step- commented Apr 18, 2024

The other error, "implicit declaration of yywarning" is less clear without more information. Is your build running bison to overwrite the parser.c file? It think the build shouldn't mess with the included parser.[ch] because they were generated a long time ago with an old bison version.

@peabee
Copy link
Contributor Author

peabee commented Apr 18, 2024

Hi Step - thanks for your interest
The petbuild is at:
https://github.com/puppylinux-woof-CE/woof-CE/blob/testing/woof-code/rootfs-petbuilds/gtkdialog/petbuild

I'm doing a GTK+2 build so the build instructions are:

        cd gtkdialog-0.8.5d
        ./autogen.sh --prefix=/usr --bindir=/usr/sbin
        make install
        ln -s gtkdialog /usr/sbin/gtk2dialog

No mention of bison....

step- added a commit to step-/gtkdialog that referenced this issue Apr 19, 2024
step- added a commit to step-/gtkdialog that referenced this issue Apr 19, 2024
it's inconsistent with other functions in this file

for puppylinux-woof-CE#160
step- added a commit to step-/gtkdialog that referenced this issue Apr 19, 2024
@step-
Copy link
Collaborator

step- commented Apr 19, 2024

Hi peebee, please see if PR 161 can help. I can't reproduce your exact environment because I only have access to gcc-12.

@dimkr
Copy link
Contributor

dimkr commented Apr 19, 2024

I bet the problem is missing or broken bison or flex and/or a gcc/glibc mismatch (let me guess: mix of Ubuntu and Debian packages). The build passes in a clean ubuntu:noble container with all dependencies.

EDIT: nope, undefined functions when forcing use of GCC 14 in noble although it defaults to 13

@peabee
Copy link
Contributor Author

peabee commented Apr 20, 2024

Closing this issue for the moment. Have incorporated recent changes (thanks both) and re-released version 0.8.5d. Looks like Ubuntu Noble Numbat is shipping with gcc-13 and gcc-14, although available, is "experimental".
I will probably stick with gcc-12 for NoblePup32 - Dimkr is probably correct that my "devx" for gcc-13 is probably inconsistent and maybe incomplete.

@peabee peabee closed this as completed Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants