Skip to content

Fix incompatible pointer type errors from GCC 15#11

Open
andersk wants to merge 1 commit intoarminbiere:masterfrom
andersk:incompatible-pointer-type
Open

Fix incompatible pointer type errors from GCC 15#11
andersk wants to merge 1 commit intoarminbiere:masterfrom
andersk:incompatible-pointer-type

Conversation

@andersk
Copy link
Copy Markdown

@andersk andersk commented Jan 2, 2026

gcc -W -Wall -O3 -DNLGLOG -DNDEBUG -DNCHKSOL -DNLGLDRUPLIG -DNLGLYALSAT -DNLGLFILES -DNLGLDEMA -c treengeling.c
treengeling.c: In function ‘initroot’:
treengeling.c:821:26: error: passing argument 2 of ‘lglsetmsglock’ from incompatible pointer type [-Wincompatible-pointer-types]
  821 |     lglsetmsglock (root, lockmsg, unlockmsg, 0);
      |                          ^~~~~~~
      |                          |
      |                          void (*)(void)
In file included from treengeling.c:5:
lglib.h:346:35: note: expected ‘void (*)(void *)’ but argument is of type ‘void (*)(void)’
  346 | void lglsetmsglock (LGL *, void (*lock)(void*), void (*unlock)(void*), void*);
      |                            ~~~~~~~^~~~~~~~~~~~
treengeling.c:260:15: note: ‘lockmsg’ declared here
  260 |   static void lock ## NAME () { \
      |               ^~~~
treengeling.c:272:1: note: in expansion of macro ‘LOCK’
  272 | LOCK (msg)
      | ^~~~
treengeling.c:821:35: error: passing argument 3 of ‘lglsetmsglock’ from incompatible pointer type [-Wincompatible-pointer-types]
  821 |     lglsetmsglock (root, lockmsg, unlockmsg, 0);
      |                                   ^~~~~~~~~
      |                                   |
      |                                   void (*)(void)
lglib.h:346:56: note: expected ‘void (*)(void *)’ but argument is of type ‘void (*)(void)’
  346 | void lglsetmsglock (LGL *, void (*lock)(void*), void (*unlock)(void*), void*);
      |                                                 ~~~~~~~^~~~~~~~~~~~~~
treengeling.c:264:15: note: ‘unlockmsg’ declared here
  264 |   static void unlock ## NAME () { \
      |               ^~~~~~
treengeling.c:285:1: note: in expansion of macro ‘UNLOCK’
  285 | UNLOCK (msg)
      | ^~~~~~
treengeling.c: In function ‘newnode’:
treengeling.c:860:28: error: passing argument 2 of ‘lglsetmsglock’ from incompatible pointer type [-Wincompatible-pointer-types]
  860 |   lglsetmsglock (res->lgl, lockmsg, unlockmsg, 0);
      |                            ^~~~~~~
      |                            |
      |                            void (*)(void)
lglib.h:346:35: note: expected ‘void (*)(void *)’ but argument is of type ‘void (*)(void)’
  346 | void lglsetmsglock (LGL *, void (*lock)(void*), void (*unlock)(void*), void*);
      |                            ~~~~~~~^~~~~~~~~~~~
treengeling.c:260:15: note: ‘lockmsg’ declared here
  260 |   static void lock ## NAME () { \
      |               ^~~~
treengeling.c:272:1: note: in expansion of macro ‘LOCK’
  272 | LOCK (msg)
      | ^~~~
treengeling.c:860:37: error: passing argument 3 of ‘lglsetmsglock’ from incompatible pointer type [-Wincompatible-pointer-types]
  860 |   lglsetmsglock (res->lgl, lockmsg, unlockmsg, 0);
      |                                     ^~~~~~~~~
      |                                     |
      |                                     void (*)(void)
lglib.h:346:56: note: expected ‘void (*)(void *)’ but argument is of type ‘void (*)(void)’
  346 | void lglsetmsglock (LGL *, void (*lock)(void*), void (*unlock)(void*), void*);
      |                                                 ~~~~~~~^~~~~~~~~~~~~~
treengeling.c:264:15: note: ‘unlockmsg’ declared here
  264 |   static void unlock ## NAME () { \
      |               ^~~~~~
treengeling.c:285:1: note: in expansion of macro ‘UNLOCK’
  285 | UNLOCK (msg)
      | ^~~~~~
treengeling.c: In function ‘startparallel’:
treengeling.c:1043:32: error: passing argument 2 of ‘lglsetmsglock’ from incompatible pointer type [-Wincompatible-pointer-types]
 1043 |   lglsetmsglock (parallel.lgl, lockmsg, unlockmsg, 0);
      |                                ^~~~~~~
      |                                |
      |                                void (*)(void)
lglib.h:346:35: note: expected ‘void (*)(void *)’ but argument is of type ‘void (*)(void)’
  346 | void lglsetmsglock (LGL *, void (*lock)(void*), void (*unlock)(void*), void*);
      |                            ~~~~~~~^~~~~~~~~~~~
treengeling.c:260:15: note: ‘lockmsg’ declared here
  260 |   static void lock ## NAME () { \
      |               ^~~~
treengeling.c:272:1: note: in expansion of macro ‘LOCK’
  272 | LOCK (msg)
      | ^~~~
treengeling.c:1043:41: error: passing argument 3 of ‘lglsetmsglock’ from incompatible pointer type [-Wincompatible-pointer-types]
 1043 |   lglsetmsglock (parallel.lgl, lockmsg, unlockmsg, 0);
      |                                         ^~~~~~~~~
      |                                         |
      |                                         void (*)(void)
lglib.h:346:56: note: expected ‘void (*)(void *)’ but argument is of type ‘void (*)(void)’
  346 | void lglsetmsglock (LGL *, void (*lock)(void*), void (*unlock)(void*), void*);
      |                                                 ~~~~~~~^~~~~~~~~~~~~~
treengeling.c:264:15: note: ‘unlockmsg’ declared here
  264 |   static void unlock ## NAME () { \
      |               ^~~~~~
treengeling.c:285:1: note: in expansion of macro ‘UNLOCK’
  285 | UNLOCK (msg)
      | ^~~~~~
make: *** [makefile:53: treengeling.o] Error 1

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
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.

1 participant