Open HkLuna opened 2 months ago
This is with version 2.1, right? Unfortunately, that version doesn't compile well with the latest compilers. Please try out version 2.2rc1 or the current "main" branch from Github (i.e. git clone git@github.com:iraf-community/x11iraf.git
).
I tried 2.2rc1 2.1 and the beta 2.0, and as i described i already cloned from git and gave the same error, i as well tried this one https://aur.archlinux.org/x11iraf-git.git and it was the same error as all versions i tried
I am rather sure that this is from 2.1 and not the current Git repository state, because the first error message is
client.c: In function ‘ClientEvaluate’:
client.c:137:53: error: passing argument 4 of ‘Tcl_SplitList’ from incompatible pointer type [-Wincompatible-pointer-types]
137 | literal: if (Tcl_SplitList (tcl, command, &argc, &argvp) == TCL_OK) {
| ^~~~~~
| |
| char ***
In file included from /usr/include/tcl.h:2421,
from ObmP.h:76,
from client.c:4:
/usr/include/tclDecls.h:722:49: note: expected ‘const char ***’ but argument is of type ‘char ***’
722 | CONST84 char ***argvPtr);
| ^
client.c: In function ‘clientGcmd’:
but argvp
is mentioned to be char ***
but is declared as const char ***
here: https://github.com/iraf-community/x11iraf/blob/92133fd1d555fcd019a89cbc4a72ce2da36011bf/obm/client.c#L126
As I said, this was already fixed after the release of x11iraf-2.1.
Hey, as i said in the previous comment, i did install all the versions from 2.0 to 2.2rc1 and yes one of the error messages i copied is from version 2.1, as you can clearly see in the error message that you copied on the end it says "make[1]: Leaving directory '/home/vale/Downloads/x11iraf-2.1/obm'" but the second error message i copied that i specified that has another type of error has the following
"widget.c: In function ‘widgetSetList’:
widget.c:2222:33: error: passing argument 2 of ‘XawListChange’ from incompatible pointer type [-Wincompatible-pointer-types]
2222 | XawListChange (wp->w, items, nitems, 0, resize);
| ^~~~~
| |
| const char **
In file included from ObmP.h:30,
from widget.c:5:
/usr/include/X11/Xaw/List.h:170:26: note: expected ‘char **’ but argument is of type ‘const char **’
170 | String *list,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~"
Again as i already said before, i compiled all versions and all versions gave the error of incompatible pointers, 2.0 and 2.1 gave the error that you already said happens only on 2.1 and as i said previously i also tried both 2.2rc1 and the git clone one and both gave the error i copied and isolated on this comment so you can see that while its the same error, its a different part of the code.
It is useful to stick on the latest commit in the repository for bug hunting, as otherwise I would need to dig out what is actual and what is not. Also, please try to format the messages as code so that remain readable (I corrected this in your previous messages).
I must say that my file /usr/include/X11/Xaw/List.h
(package libxaw7-dev 1.0.14 on Debian) is slightly different; the declaration of the argument is there
void XawListChange
(
Widget w,
_Xconst char **list,
int nitems,
int longest,
#if NeedWidePrototypes
int resize
#else
Boolean resize
#endif
);
with _Xconst
being defined as const
in /usr/include/X11/Xfuncproto.h
. You probably use a newer Xaw libary which uses String
here. You therefore could try to add -D_CONST_X_STRING
to your CPPFLAGS
which make strings constant.
Here is the error when compiling it on Fedora 41
$ make
make -C obm
make[1]: Entering directory '/home/.../Downloads/x11iraf-main/obm'
cc -I/usr/include/tcl -c -o Obm.o Obm.c
cc -I/usr/include/tcl -c -o client.o client.c
cc -I/usr/include/tcl -c -o param.o param.c
cc -I/usr/include/tcl -c -o server.o server.c
server.c: In function ‘serverGetResources’:
server.c:983:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
983 | r->resource_offset = (unsigned int) &(((Value *)NULL)[item].value);
| ^
cc -I/usr/include/tcl -c -o widget.o widget.c
widget.c: In function ‘widgetSPCallback’:
widget.c:1282:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1282 | sprintf (message, "%d", (int)call_data);
| ^
widget.c: In function ‘widgetSetList’:
widget.c:2222:33: error: passing argument 2 of ‘XawListChange’ from incompatible pointer type [-Wincompatible-pointer-types]
2222 | XawListChange (wp->w, items, nitems, 0, resize);
| ^~~~~
| |
| const char **
In file included from ObmP.h:30,
from widget.c:5:
/usr/include/X11/Xaw/List.h:170:26: note: expected ‘char **’ but argument is of type ‘const char **’
170 | String *list,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
widget.c: In function ‘widgetAddEventHandler’:
widget.c:4391:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
4391 | new_cb->client_data = (XtPointer) event_mask;
| ^
widget.c: In function ‘widgetRemoveEventHandler’:
widget.c:4434:42: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
4434 | XtRemoveEventHandler (wp->w, (int) cb->client_data, nonmaskable,
| ^
widget.c: In function ‘widgetEvent’:
widget.c:4557:29: warning: ‘XKeycodeToKeysym’ is deprecated [-Wdeprecated-declarations]
4557 | keysym = XKeycodeToKeysym (obm->display,
| ^~~~~~
In file included from /usr/include/X11/Intrinsic.h:53,
from ObmP.h:16:
/usr/include/X11/Xlib.h:1683:15: note: declared here
1683 | extern KeySym XKeycodeToKeysym(
| ^~~~~~~~~~~~~~~~
make[1]: *** [<builtin>: widget.o] Error 1
make[1]: Leaving directory '/home/jhwu/Downloads/x11iraf-main/obm'
make: *** [Makefile:11: obm/libobm.a] Error 2
Did you try my recommendation above?
You therefore could try to add -D_CONST_X_STRING to your CPPFLAGS which make strings constant.
Hello, as the title says when i try to compile x11iraf on ARCH there is an error regarding incompatible pointers both when i downloaded directly from github repository and arch repository
The error from the github download x11iraf
And here is the error from the ARCH repository
I tried reinstalling all libraries and went one by one on the dependencies making sure that they are installed, specially TCL. Hopes this bug report helps making this tool fully available on ARCH