[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug report in Tcl if you are using Linux



When I went to install the ns-allinone-2.1b5 on Redhat 6.0 with Linux kernel
2.2.5-15 I got an error during compilation that there were duplicate case
statements in tclPosixStr.c in the functions Tcl_ErrnoId() and
Tcl_ErrnoMsg().  After checking the file I realized the compiler was
complaining that the #defined ENOTSUP and EOPNOTSUPP values in different
case statements in these functions had the same value.  These statements are
not defined the same in the ns-allinone package, but if you look in
/usr/include/bits/errno.h you will find the following statement
# define ENOTSUP EOPNOTSUPP
so ENOTSUP is defined to the same value as EOPNOTSUPP in Linux.  Note this
may not be true with different Linux kernel versions.

The solution I came up with was to
/*
#ifdef ENOTSUP
        case ENOTSUP: return "ENOTSUP";
#endif
*/

/*
#ifdef ENOTSUP
        case ENOTSUP: return "operation not supported";
#endif
*/
comment out both of the above statements in tclPosixStr.c.  They should be
around lines 328 and 775, respectively.  After doing this everything seemed
to compile and work fine.  Ok hope this helps anyone else who may encounter
this problem.  It may also be worth mentioning this problem on
http://www-mash.CS.Berkeley.EDU/ns/ns-problems.html if it can help others.

Jeff