Tcl Source Code

View Ticket
Login
Ticket UUID: 1911102
Title: tclUnixPort.h MODULE_SCOPE compile error
Type: Bug Version: obsolete: 8.5.2
Submitter: lvirden Created on: 2008-03-10 14:30:34
Subsystem: 52. Portability Support Assigned To: jenglish
Priority: 4 Severity:
Status: Closed Last Modified: 2008-03-12 07:19:51
Resolution: Fixed Closed By: das
    Closed on: 2008-03-11 22:38:08
Description:
Over the past couple of weeks, I've been working on trying to get the expect cvs head to compile. It generates a compile error. At first, I just assumed there was a problem in expect.

Today, I'm not so certain.

The expect cvs head, built against the Tcl 8.5b1 cvs head, says this:

cc -DPACKAGE_NAME=\"expect\" -DPACKAGE_TARNAME=\"expect\" -DPACKAGE_VERSION=\"5.
44.1.5\" -DPACKAGE_STRING=\"expect\ 5.44.1.5\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_H
EADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRIN
G_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1
 -DWORDS_BIGENDIAN=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1
 -D_REENTRANT=1 -D_POSIX_PTHREAD_SEMANTICS=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -D
_REENTRANT=1 -D_POSIX_PTHREAD_SEMANTICS=1 -DTCL_WIDE_INT_IS_LONG=1 -DUSE_TCL_STU
BS=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYSMACROS_H=1 -DHAVE_VARARGS_H=1 -DHAVE_STROPT
S_H=1 -DHAVE_SYSCONF_H=1 -DHAVE_SYS_FCNTL_H=1 -DHAVE_SYS_PTEM_H=1 -DHAVE_STRREDI
R_H=1 -DRETSIGTYPE=void -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME
=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TIMEZONE_VAR=1 -DNO_UNION_WAIT=
1 -DSOLARIS=1 -DHAVE_MEMMOVE=1 -DHAVE_SYSCONF=1 -DHAVE_STRFTIME=1 -DHAVE_STRCHR=
1 -DHAVE_TIMEZONE=1 -DHAVE_SIGLONGJMP=1 -DHAVE_MEMCPY=1 -DWNOHANG_BACKUP_VALUE=6
4 -DSELECT_MASK_TYPE=fd_set -DREARM_SIG=1 -DHAVE_PTMX=1 -DHAVE_TCSETATTR=1 -DPOS
IX=1 -DHAVE_SGTTYB=1 -DHAVE_TERMIO=1 -DHAVE_TERMIOS=1 -DHAVE_TCGETS_OR_TCGETA_IN
_TERMIOS_H=1 -DHAVE_TIOCGWINSZ_IN_TERMIOS_H=1 -DSETPGRP_VOID=1 -DHAVE_SV_TIMEZON
E=1 -DHAVE_LONG_FILE_NAMES=1  -DTCL_DEBUGGER -DUSE_NON_CONST -DSCRIPTDIR=\"/proj
ects/sprs_lwv/tcl85/lib/expect5.44.1.5\" -DEXECSCRIPTDIR=\"/projects/sprs_lwv/tc
l85/lib/expect5.44.1.5\" -DSTTY_BIN=\"/bin/stty\" -DDFLT_STTY="\"sane\"" -I. -I"
.." -I"/vol/tclsrcsol/tcl85/tcl/generic" -I"/vol/tclsrcsol/tcl85/tcl/unix" -I"/p
rojects/sprs_lwv/tcl85/include"    -xarch=v9   -KPIC -c `echo ../exp_tty.c` -o e
xp_tty.o
"/vol/tclsrcsol/tcl85/tcl/unix/tclUnixPort.h", line 112: warning: old-style decl
aration or incorrect type for: MODULE_SCOPE
"/vol/tclsrcsol/tcl85/tcl/unix/tclUnixPort.h", line 112: syntax error before or 
at: int
cc: acomp failed for ../exp_tty.c
gmake: *** [exp_tty.o] Error 2


When I look in exp_tty.c, I don't see any references to MODULE_SCOPE (and in fact, the error doesn't claim there were any - it specifically mentions tclUnixPort.h.

So, I look at that file, and here's what I see:

At line 112, I see the line:

MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode);
This is the first reference to MODULE_SCOPE.

Then, at line 626, I see:
#ifndef MODULE_SCOPE
#define MODULE_SCOPE extern
#endif

It seems, to me, these 3 lines should appear before line 112, shouldn't they?  Or else that line should move down to this point...
User Comments: jenglish added on 2008-03-12 07:19:51:
Logged In: YES 
user_id=68433
Originator: NO

Oops!  Sorry about that.

But expect really needs to start using its own portability autogoo and stop relying on Tcl's.

das added on 2008-03-12 05:38:08:
Logged In: YES 
user_id=90580
Originator: NO

problem introduced by jenglish with his USE_FIONBIO consolidation:
    http://rutherglen.ics.mq.edu.au/fisheye/changelog/Tcl?cs=MAIN:jenglish:20080228201209
fixed in HEAD by moving MODULE_SCOPE compat define to top of tclUnixPort.h

[email protected] added on 2008-03-11 19:47:51:
Logged In: NO 

Even though expect's configure needs a change, the module_scope use should be moved to after it is ifdef'd.

dkf added on 2008-03-11 19:23:26:
Logged In: YES 
user_id=79902
Originator: NO

Expect's configure.in needs to call SC_CONFIG_CFLAGS (or use the relevant bit from inside it's definition; see tcl.m4 for gory details).

lvirden added on 2008-03-11 19:09:26:

File Added - 269949: pat.tclUnixPort

Logged In: YES 
user_id=15949
Originator: YES

Here's a patch for the problem
File Added: pat.tclUnixPort

Attachments: