Skip to content

Conversation

@Integral-Tech
Copy link
Contributor

ui/ui.c: In function ‘stopHp’:
ui/ui.c:140:37: error: passing argument 2 of ‘g_thread_new’ from incompatible pointer type [-Wincompatible-pointer-types]
  140 |         g_thread_new("init_running",init_running_info,NULL);
      |                                     ^~~~~~~~~~~~~~~~~
      |                                     |
      |                                     void * (*)(void)
In file included from /usr/include/glib-2.0/glib/gasyncqueue.h:34,
                 from /usr/include/glib-2.0/glib.h:34,
                 from /usr/include/gtk-3.0/gdk/gdkconfig.h:8,
                 from /usr/include/gtk-3.0/gdk/gdk.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from ui/ui.c:33:
/usr/include/glib-2.0/glib/gthread.h:152:66: note: expected ‘GThreadFunc’ {aka ‘void * (*)(void *)’} but argument is of type ‘void * (*)(void)’
  152 |                                                  GThreadFunc     func,
      |                                                  ~~~~~~~~~~~~~~~~^~~~
In file included from ui/ui.c:39:
ui/ui.h:51:7: note: ‘init_running_info’ declared here
   51 | void* init_running_info();
      |       ^~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:49:20: note: ‘GThreadFunc’ declared here
   49 | typedef gpointer (*GThreadFunc) (gpointer data);
      |                    ^~~~~~~~~~~
ui/ui.c: In function ‘on_stop_hp_clicked’:
ui/ui.c:168:28: error: passing argument 2 of ‘g_thread_new’ from incompatible pointer type [-Wincompatible-pointer-types]
  168 |     g_thread_new("shell2", stopHp, NULL);
      |                            ^~~~~~
      |                            |
      |                            void * (*)(void)
/usr/include/glib-2.0/glib/gthread.h:152:66: note: expected ‘GThreadFunc’ {aka ‘void * (*)(void *)’} but argument is of type ‘void * (*)(void)’
  152 |                                                  GThreadFunc     func,
      |                                                  ~~~~~~~~~~~~~~~~^~~~
ui/ui.c:134:14: note: ‘stopHp’ declared here
  134 | static void *stopHp() {
      |              ^~~~~~
/usr/include/glib-2.0/glib/gthread.h:49:20: note: ‘GThreadFunc’ declared here
   49 | typedef gpointer (*GThreadFunc) (gpointer data);
      |                    ^~~~~~~~~~~
ui/ui.c: In function ‘initUi’:
ui/ui.c:489:33: error: passing argument 2 of ‘g_thread_new’ from incompatible pointer type [-Wincompatible-pointer-types]
  489 |     g_thread_new("init_running",init_running_info,NULL);
      |                                 ^~~~~~~~~~~~~~~~~
      |                                 |
      |                                 void * (*)(void)
/usr/include/glib-2.0/glib/gthread.h:152:66: note: expected ‘GThreadFunc’ {aka ‘void * (*)(void *)’} but argument is of type ‘void * (*)(void)’
  152 |                                                  GThreadFunc     func,
      |                                                  ~~~~~~~~~~~~~~~~^~~~
ui/ui.h:51:7: note: ‘init_running_info’ declared here
   51 | void* init_running_info();
      |       ^~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:49:20: note: ‘GThreadFunc’ declared here
   49 | typedef gpointer (*GThreadFunc) (gpointer data);
      |                    ^~~~~~~~~~~
make[2]: *** [Makefile:35: ../build/ui.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/build/linux-wifi-hotspot-git/src/linux-wifi-hotspot/src'
make[1]: *** [Makefile:32: resources.c] Error 2
make[1]: Leaving directory '/build/linux-wifi-hotspot-git/src/linux-wifi-hotspot/src'
make: *** [Makefile:5: all] Error 2

@lakinduakash lakinduakash merged commit ea15513 into lakinduakash:master Jun 7, 2025
2 checks passed
@Integral-Tech Integral-Tech deleted the fix-build-error branch June 7, 2025 12:13
@joanbm joanbm mentioned this pull request Jul 22, 2025
@blechta
Copy link

blechta commented Aug 28, 2025

This PR breaks build with GCC 9 (for example gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0):

gcc -c -o ../build/ui.o ui/ui.c `pkg-config --cflags gtk+-3.0`
ui/ui.c: In function ‘stopHp’:
ui/ui.c:134:21: error: parameter name omitted
  134 | static void *stopHp(void *) {
      |                     ^~~~~~
ui/ui.c: In function ‘init_running_info’:
ui/ui.c:713:25: error: parameter name omitted
  713 | void* init_running_info(void *){
      |                         ^~~~~~

Here's a workaround

diff --git a/src/ui/ui.c b/src/ui/ui.c
index 0af37de..906c555 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -131,7 +131,7 @@ static ConfigValues configValues;
 
 
 
-static void *stopHp(void *) {
+static void *stopHp(void *unused) {
     if(running_info[0]!=NULL){
         gtk_label_set_label(label_status,"Stopping ...");
         start_pb_pulse();
@@ -710,7 +710,7 @@ void clear_running_info(){
         running_info[0]=NULL;
 }
 
-void* init_running_info(void *){
+void* init_running_info(void *unused){
 
     clear_running_info();
     lock_all_views(TRUE);

@lakinduakash
Copy link
Owner

lakinduakash commented Aug 29, 2025

Can you please make a PR to fix this. Thanks

@blechta blechta mentioned this pull request Sep 2, 2025
@blechta
Copy link

blechta commented Sep 2, 2025

See #489

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

Successfully merging this pull request may close these issues.

3 participants