Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Checkin cd7415d81d for bug 3508771 breaks Tcl_StatBuf

Closed / Invalid3524165fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2012-05-06 21:34:28
Checkin cd7415d81d for bug 3508771 breaks Tcl_StatBuf on mingw32.

The issue is that it typedef's Tcl_StatBuf to a structure that it does not define.

This manifests itself as an issue for building extensions that access Tcl_StatBuf:

tclvfs-20080503]$ i586-mingw32msvc-gcc -pipe -DPACKAGE_NAME=\"vfs\" -DPACKAGE_TARNAME=\"vfs\" -DPACKAGE_VERSION=\"1.3\" -DPACKAGE_STRING=\"vfs\ 1.3\" -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_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DNO_SYS_WAIT_H=1 -DNO_DLFCN_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DSTATIC_BUILD=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_LSEEK64=1   -I"/home/rkeene/devel/kitcreator/tcl/build/tclfossil_cd7415d81d/generic" -I"/home/rkeene/devel/kitcreator/tcl/build/tclfossil_cd7415d81d/generic" -I"/home/rkeene/devel/kitcreator/tcl/build/tclfossil_cd7415d81d/unix"    -I/home/rkeene/devel/kitcreator/tcl/build/tclfossil_cd7415d81d/win -O2 -fomit-frame-pointer -Wall -Wno-implicit-int -c `echo vfs.c` -o vfs.o
vfs.c: In function 'VfsStat':
vfs.c:1111: error: dereferencing pointer to incomplete type
vfs.c:1125: error: dereferencing pointer to incomplete type
vfs.c:1132: error: dereferencing pointer to incomplete type
vfs.c:1139: error: dereferencing pointer to incomplete type
vfs.c:1146: error: dereferencing pointer to incomplete type
vfs.c:1153: error: dereferencing pointer to incomplete type
vfs.c:1160: error: dereferencing pointer to incomplete type
vfs.c:1167: error: dereferencing pointer to incomplete type
vfs.c:1174: error: dereferencing pointer to incomplete type
vfs.c:1181: error: dereferencing pointer to incomplete type
vfs.c:1188: error: dereferencing pointer to incomplete type
vfs.c:1193: error: dereferencing pointer to incomplete type
vfs.c:1195: error: dereferencing pointer to incomplete type
vfs.c:1198: error: dereferencing pointer to incomplete type

vfs.c:1111 is:     bufPtr->st_mode = 0;

bufPtr is:     Tcl_StatBuf *bufPtr;

gcc -E output is:


$ i586-mingw32msvc-gcc -E ... vfs.c | grep Tcl_StatBuf
 typedef struct _stat32i64 Tcl_StatBuf;
...
$


However struct _stat32i64 is never defined:

$ i586-mingw32msvc-gcc -E ... vfs.c | grep _stat32i64
 typedef struct _stat32i64 Tcl_StatBuf;
$


Tcl_StatBuf should be typedef'd to something that is defined.
rkeeneplain2012-05-07 04:51:36
allow_comments - 1

Duplicate of bug 3474726
nijtmansplain2012-05-07 04:55:03
It's not Tcl's fault that mingw doesn't define _stat32i64

But there is a workaround: compile your extension
with -D_USE_32BIT_TIME_T, then it will work.

See also, bug 3474726
Log in (anonymous is fine) to add a comment.