Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-04-13
00:35 • Closed ticket [2440625fff]: compile warning for tclBasic.c plus 7 other chan... artifact: 3defd7962b user: msofer
00:35 • Ticket [2440625fff]: 4 changes artifact: b1497e089f user: msofer
2011-04-12
09:33 • Ticket [2440625fff]: 1 change artifact: b3da56e686 user: msofer
2009-05-01
08:30 • Ticket [2440625fff]: 1 change artifact: edc1bc9cb7 user: msofer
2008-12-17
23:49 • Ticket [2440625fff]: 4 changes artifact: 2a2d6ab331 user: kennykb
23:49 • Add attachment 2440625.patch to ticket [2440625fff] artifact: 035c846422 user: kennykb
23:44 • Ticket [2440625fff] compile warning for tclBasic.c status still Open with 4 ... artifact: 4e70d9210c user: dkf
23:23 • Ticket [2440625fff]: 4 changes artifact: 7d2da22f1e user: ferrieux
23:10 • Ticket [2440625fff]: 1 change artifact: be65ed76b3 user: dkf
23:10 • Ticket [2440625fff]: 4 changes artifact: 619bb0f068 user: dkf
22:42 • Ticket [2440625fff]: 5 changes artifact: 3fb2fbdb01 user: dgp
22:19 • Ticket [2440625fff]: 2 changes artifact: a91f42e4a3 user: dgp
15:13 • New ticket [2440625fff]. artifact: c415524580 user: lvirden

compile warning for tclBasic.c

Closed / Fixed2440625fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 16 years ago
Descriptionplain2008-12-17 15:13:16
platform: sun sparc solaris 8, sun c compiler, tcl 8.6 cvs head

During the gmake all step, the following warning is produced:

      /vol/tclsrcsol/tcl86/tcl/unix/../generic/tclAsync.c
/opt/SUNWspro/bin/cc -c -g    -KPIC -I"." -I/vol/tclsrcsol/tcl86/tcl/unix/../unix -I/vol/tclsrcsol/tcl86/tcl/unix/../generic -I/vol/tclsrcsol/tcl86/tcl/unix/../
libtommath -DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"
8.6\" -DPACKAGE_STRING=\"tcl\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -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_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -D_REENTRANT=1 
-D_POSIX_PTHREAD_SEMANTICS=1 -DTCL_SHLIB_EXT=\".so\" -DTCL_CFG_DEBUG=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_DIRENT64=1 -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1 -DWORDS_BIGENDIAN=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -
DHAVE_GETADDRINFO=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -
DHAVE_DECL_TZNAME=1 -DHAVE_TZNAME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1
 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -DTCL_UNLOAD_DLLS=1
      /vol/tclsrcsol/tcl86/tcl/unix/../generic/tclBasic.c
"/vol/tclsrcsol/tcl86/tcl/unix/../generic/tclBasic.c", line 4297: warning: assignment type mismatch:
        pointer to function(pointer to void, pointer to struct Tcl_Interp {pointer to char unused3, pointer to function(..) returning void unused4, int unused5}
, int, pointer to const pointer to struct Tcl_Obj {int refCount, pointer to char
 bytes, int length, pointer to const struct Tcl_ObjType {..} typePtr, union  {..
} internalRep}) returning int "=" pointer to void

While I understand it is "just" a warning, I thought it might be worthwhile hearing about in case there is something that can be done about it.
dgp Ticket [2440625fff]: 2 changes [History diff]2008-12-17 22:19:10
dgpplain2008-12-17 22:42:07
best to add a typecast?
dkfplain2008-12-17 23:10:13
Problem is, C doesn't guarantee that sizeof(void*)==sizeof(Tcl_ObjCmdProc*) for various reasons. (If they are the same, it's a safe thing to do. If they aren't, it's disastrous.)

So, a cast and an assert. (Assigning to originator of this code.)
dkf Ticket [2440625fff]: 1 change [History diff]2008-12-17 23:10:15
ferrieuxplain2008-12-17 23:23:55
Donal, can you give a pointer (pun intended) to a relevant standard excerpt showing this unbelievable degree of freedom ? Or details about the "various reasons" ?
dkfplain2008-12-17 23:44:54
I just googled (and relied on memory and kbk and jenglish)
kennykbplain2008-12-17 23:49:30
File Added - 305728: 2440625.patch

Possible fix attached, should have near zero performance impact since it's just moving code. Test suite passes with the patch applied. I don't claim to know about all the implications of delaying the fetch of objProc and clientData.
File Added: 2440625.patch
msofer Ticket [2440625fff]: 1 change [History diff]2009-05-01 08:30:09
msofer Ticket [2440625fff]: 1 change [History diff]2011-04-12 09:33:54
msoferplain2011-04-13 00:35:08
Patch adapted to trunk and committed
msoferplain2011-04-13 00:35:15
allow_comments - 1
Log in (anonymous is fine) to add a comment.

Attachments: