compile error: tcl8.0.3 RH 6.1 LINUX 
Author Message
 compile error: tcl8.0.3 RH 6.1 LINUX

Hi everyone

This is a description of a problem and workaround which I encountered.
If anyone has hit this before and has a better solution I'd love to hear
it.

I've just been building tcl on my Linux box (Red Hat 6.1) and during the
"make" step came up with the following error:

./../generic/tclPosixStr.c: In function `Tcl_ErrnoId':
./../generic/tclPosixStr.c:340: duplicate case value
./../generic/tclPosixStr.c:328: this is the first entry for that value
./../generic/tclPosixStr.c: In function `Tcl_ErrnoMsg':
./../generic/tclPosixStr.c:787: duplicate case value
./../generic/tclPosixStr.c:775: this is the first entry for that value
make: *** [tclPosixStr.o] Error 1

It turns out that the tclPosixStr.c file is set up to produce a whole
lot of case statements, depending on the values of various macros, and
the file is basically set up by the c-compiler pre-processor using
#ifdef constructs.

To cause the above error, two case statements are set up with the same
value. This happens twice (once in each of two functions) , hence the
repetition above. The offending lines (from the first function) are as
follows:

#ifdef ENOTSUP
        case ENOTSUP: return "ENOTSUP";

#ifdef EOPNOTSUPP
        case EOPNOTSUPP: return "EOPNOTSUPP";

We find, in the /usr/include/bits/errno.h file that ENOTSUP is defined
to EOPNOTSUPP due to LINUX "not having" an ENOTSUP error code. This
causes the duplicate case above. So the problem appears to be a RH linux
problem mainly. I performed the following work around:

I removed the ENOTSUP possible case and modified the EOPNOTSUP one to
the following:

#ifdef EOPNOTSUPP
        case EOPNOTSUPP: return "EOPNOTSUPP | ENOTSUPP";

This obviously has to be done in both the Tcl_ErrnoId and Tcl_ErrnoMsg
functions.

Following the above modification, the code compiled smoothly.

This is really just a hack (I have no idea what the code is supposed to
be doing) so please let me know if there is a better solution.

Cheers
James

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 03 Nov 2002 03:00:00 GMT  
 compile error: tcl8.0.3 RH 6.1 LINUX

Quote:

> Hi everyone

> This is a description of a problem and workaround which I encountered.
> If anyone has hit this before and has a better solution I'd love to hear
> it.

> I've just been building tcl on my Linux box (Red Hat 6.1) and during the
> "make" step came up with the following error:

> ./../generic/tclPosixStr.c: In function `Tcl_ErrnoId':
> ./../generic/tclPosixStr.c:340: duplicate case value
> ./../generic/tclPosixStr.c:328: this is the first entry for that value
> ./../generic/tclPosixStr.c: In function `Tcl_ErrnoMsg':
> ./../generic/tclPosixStr.c:787: duplicate case value
> ./../generic/tclPosixStr.c:775: this is the first entry for that value
> make: *** [tclPosixStr.o] Error 1

> It turns out that the tclPosixStr.c file is set up to produce a whole
> lot of case statements, depending on the values of various macros, and
> the file is basically set up by the c-compiler pre-processor using
> #ifdef constructs.

> To cause the above error, two case statements are set up with the same
> value. This happens twice (once in each of two functions) , hence the
> repetition above. The offending lines (from the first function) are as
> follows:

> #ifdef ENOTSUP
>         case ENOTSUP: return "ENOTSUP";

> #ifdef EOPNOTSUPP
>         case EOPNOTSUPP: return "EOPNOTSUPP";

> We find, in the /usr/include/bits/errno.h file that ENOTSUP is defined
> to EOPNOTSUPP due to LINUX "not having" an ENOTSUP error code. This
> causes the duplicate case above. So the problem appears to be a RH linux
> problem mainly. I performed the following work around:

> I removed the ENOTSUP possible case and modified the EOPNOTSUP one to
> the following:

> #ifdef EOPNOTSUPP
>         case EOPNOTSUPP: return "EOPNOTSUPP | ENOTSUPP";

> This obviously has to be done in both the Tcl_ErrnoId and Tcl_ErrnoMsg
> functions.

> Following the above modification, the code compiled smoothly.

> This is really just a hack (I have no idea what the code is supposed to
> be doing) so please let me know if there is a better solution.

The better solution is to do something similar to other possibly duplicate
cases in that file. Use conditional compilation to compare the values
of the two potentially conflicting defines and if they match have one case,
if they don't match have two cases.


Sun, 03 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. mysql module w/ RH 6.1 or Mandrake 6.0

2. place to compile f90 code for RH linux

3. compile tcl/tk 8.3 on RH Linux 5.2

4. Cant compile 8.2.1 on RH linux

5. gcl build error on RH Linux 7.3

6. Failed tests compiling tcl8.4a1 on SuSE6.4 Linux - need guidance

7. compiling tcl8.0.5 on linux

8. TCL8.0.4 + ENOTSUP + Linux (redhat base) + glibc 2.0.105 - compile hassle

9. Compile error building tcl8.4.0 using MinGW-gcc, Cygwin

10. compile tcl8.3.4 on Windows98 with VC6.0 error

11. compile error on winnt tcl8.3.4 when at the last create the tcl83.dll

12. Error compiling tcl8.3.3 on SGI IRIX6.5 IP27 mips

 

 
Powered by phpBB® Forum Software