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

Compile error with TCL 8.7.a4 #2

Open
teclab-at opened this issue Jan 20, 2021 · 4 comments
Open

Compile error with TCL 8.7.a4 #2

teclab-at opened this issue Jan 20, 2021 · 4 comments

Comments

@teclab-at
Copy link

photoresize compiles fine using TCL 8.6 on W10 and Ubuntu flavours.
Using TCL 8.7a4 (latest commit as from bug filing) it compiles in W10 but fails in Ubuntu 16/18/20 with below error,
photoresize master branch, latest commit:

./generic/photoresize_wrap.cpp:1084:42: error: invalid type argument of unary ‘*’ (have ‘long int’)

g++ -DPACKAGE_NAME=\"photoresize\" -DPACKAGE_TARNAME=\"photoresize\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"photoresize\ 0.1\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1  -I"/home/gitlab-runner/builds/nAUPxsbg/0/products/tcltk/rcompile/tcl/generic" -I"/home/gitlab-runner/builds/nAUPxsbg/0/products/tcltk/rcompile/tk/generic"     -pipe -m64 -O2 -fomit-frame-pointer -Wall -fPIC  -c `echo ./generic/photoresize_wrap.cpp` -o photoresize_wrap.o
In file included from /home/gitlab-runner/builds/nAUPxsbg/0/products/tcltk/rcompile/tcl/generic/tcl.h:2388:0,
                 from ./generic/photoresize_wrap.cpp:164:
./generic/photoresize_wrap.cpp: In function ‘int SWIG_Tcl_ConvertPtrFromString(Tcl_Interp*, const char*, void**, swig_type_info*, int)’:
./generic/photoresize_wrap.cpp:1084:42: error: invalid type argument of unary ‘*’ (have ‘long int’)
       if (*(Tcl_GetStringFromObj(result, NULL)) == 0) {

Regards

@auriocus
Copy link
Owner

Not sure if this is a bug in photoresize, or in your Tcl headers?
The error says thet Tcl_GetStringFromObj() returns "long int", which is extremely strange, since it returns "char *" in previous versions - the only sensible thing for a C string. Could you check the prototypes?

@teclab-at
Copy link
Author

Yes, still defined as char*:

EXTERN char * Tcl_GetStringFromObj(Tcl_Obj *objPtr, int *lengthPtr);

(TCL 8.7 file tclDecls.h)

@auriocus
Copy link
Owner

Then it doesn't make any sense to me. Maybe it is related to the stubs thing - actually Tcl_ functions are macros expanding into some entry of the stub table. If you could run the preprocessor, maybe that makes it clearer.
BTW, that code has nothing to do with photoresize - it is the wrapper code generated by SWIG, so it would hit any other projcect using SWIG as well.

@teclab-at
Copy link
Author

I will do some further testing and see if I get any wiser ...

thx for your support!

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

2 participants