File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ Works around numerous errors of this form:
2+
3+ src/bool.c: In function ‘InitKernel’:
4+ src/bool.c:332:22: error: passing argument 1 of ‘InitHandlerFunc’ from incompatible pointer type [-Wincompatible-pointer-types]
5+ 332 | InitHandlerFunc( ReturnTrue1, "src/bool.c:ReturnTrue1" );
6+ | ^~~~~~~~~~~
7+ | |
8+ | struct OpaqueBag * (*)(struct OpaqueBag *, struct OpaqueBag *)
9+ In file included from src/bool.c:20:
10+ src/calls.h:416:30: note: expected ‘ObjFunc’ {aka ‘struct OpaqueBag * (*)(void)’} but argument is of type ‘struct OpaqueBag * (*)(struct OpaqueBag *, struct OpaqueBag *)’
11+ 416 | void InitHandlerFunc(ObjFunc hdlr, const Char * cookie);
12+ | ~~~~~~~~^~~~
13+ src/bool.c:172:12: note: ‘ReturnTrue1’ declared here
14+ 172 | static Obj ReturnTrue1(Obj self, Obj val1)
15+ | ^~~~~~~~~~~
16+ In file included from src/gasman.h:39,
17+ from src/objects.h:20,
18+ from src/bool.h:16,
19+ from src/bool.c:17:
20+ src/common.h:168:16: note: ‘ObjFunc’ declared here
21+ 168 | typedef Obj (* ObjFunc) (/*arguments*/);
22+ | ^~~~~~~
23+
24+ --- a/src/common.h.orig 2024-12-05 02:15:31.000000000 -0700
25+ +++ b/src/common.h 2025-01-16 19:37:36.186901774 -0700
26+ @@ -165,7 +165,7 @@ typedef Bag Obj;
27+ #ifndef __cplusplus
28+ #pragma GCC diagnostic ignored "-Wstrict-prototypes"
29+ #endif
30+ - typedef Obj (* ObjFunc) (/*arguments*/);
31+ + typedef void *ObjFunc;
32+ #pragma GCC diagnostic pop
33+
34+ typedef Obj (* ObjFunc_0ARGS) (Obj self);
You can’t perform that action at this time.
0 commit comments