Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2003-05-21
09:04 • Closed ticket [696854ffff]: stop defaulting to GCC compiler plus 7 other cha... artifact: 4416861bb6 user: mdejong
2003-05-13
09:51 • Ticket [696854ffff]: 4 changes artifact: ca340baa5e user: mdejong
2003-04-24
02:52 • Ticket [696854ffff]: 4 changes artifact: c1841a79e0 user: mdejong
2003-04-23
21:41 • Ticket [696854ffff]: 4 changes artifact: 2fab118a03 user: lvirden
2003-03-04
16:44 • Ticket [696854ffff]: 4 changes artifact: e1ee9d5a32 user: dkf
07:13 • Ticket [696854ffff]: 4 changes artifact: c4338d7cf8 user: jenglish
05:53 • Ticket [696854ffff]: 2 changes artifact: d3c3c0dad2 user: dgp
05:51 • Ticket [696854ffff]: 8 changes artifact: c6860ca7a8 user: dgp
04:52 • Ticket [696854ffff]: 3 changes artifact: cb7ce76754 user: jenglish
04:44 • Ticket [696854ffff]: 5 changes artifact: 867b3aea5d user: dgp
2003-03-03
21:14 • New ticket [696854ffff]. artifact: fda5cca585 user: dgp

stop defaulting to GCC compiler

Closed / Wont Fix696854ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2003-03-03 21:14:46
% parray tcl_platform
tcl_platform(byteOrder) = bigEndian
tcl_platform(machine)   = IP35
tcl_platform(os)        = IRIX64
tcl_platform(osVersion) = 6.5
tcl_platform(platform)  = unix
tcl_platform(user)      = dgp
tcl_platform(wordSize)  = 4

execute.test

==== execute-7.33 Wide int handling FAILED
==== Contents of test case:

    expr {0x1 * 1024 * 1024 * 1024 * 1024}

---- Result was:
1099511627776
---- Result should have been (exact matching):
0
==== execute-7.33 FAILED

expr-old.test

==== expr-old-32.31 math functions in expressions FAILED
==== Contents of test case:

    expr int(-1.4)

---- Result was:
integer value too large to represent
---- Result should have been (exact matching):
-1
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== expr-old-32.31 FAILED


==== expr-old-32.32 math functions in expressions FAILED
==== Contents of test case:

    expr int(-1.6)

---- Result was:
integer value too large to represent
---- Result should have been (exact matching):
-1
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== expr-old-32.32 FAILED


==== expr-old-32.37 math functions in expressions FAILED
==== Contents of test case:

    expr round(-1.49)

---- Result was:
integer value too large to represent
---- Result should have been (exact matching):
-1
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== expr-old-32.37 FAILED


==== expr-old-32.38 math functions in expressions FAILED
==== Contents of test case:

    expr round(-1.51)

---- Result was:
integer value too large to represent
---- Result should have been (exact matching):
-2
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== expr-old-32.38 FAILED


==== expr-old-37.1 Check that Tcl_ExprLong doesn't
modify interpreter result if no error FAILED
==== Contents of test case:

    testexprlong

---- Result was:
expression didn't have numeric value
---- Result should have been (exact matching):
This is a result: 5
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== expr-old-37.1 FAILED

obj.test

==== obj-27.1 Tcl_NewLongObj FAILED
==== Contents of test case:

    set result ""
    lappend result [testobj freeallvars]
    testintobj setmaxlong 1
    lappend result [testintobj ismaxlong 1]
    lappend result [testobj type 1]
    lappend result [testobj refcount 1]

---- Result was:
{} 0 int 1
---- Result should have been (exact matching):
{} 1 int 1
==== obj-27.1 FAILED

socket.test

==== socket-2.3 tcp connection with client interface
specified FAILED
==== Contents of test case:

    removeFile script
    set f [open $path(script) w]
    puts $f {
        set timer [after 2000 "set x done"]
        set f [socket  -server accept 2830]
        proc accept {file addr port} {
            global x
            puts "[gets $file] $addr"
            close $file
            set x done
        }
        puts ready
        vwait x
        after cancel $timer
        close $f
    }
    close $f
    set f [open "|[list [interpreter] $path(script)]" r]
    gets $f x
    if {[catch {socket -myaddr 127.0.0.1 127.0.0.1
2830} sock]} {
        set x $sock
    } else {
        puts $sock hello
        flush $sock
        lappend x [gets $f]
        close $sock
    }
    close $f
    set x

---- Result was:
ready {hello 0.0.0.0}
---- Result should have been (exact matching):
ready {hello 127.0.0.1}
==== socket-2.3 FAILED


==== socket-7.1 testing socket specific options FAILED
==== Contents of test case:

    removeFile script
    set f [open $path(script) w]
    puts $f {
        set ss [socket -server accept 0]
        proc accept args {
            global x
            set x done
        }
        puts ready
        puts [lindex [fconfigure $ss -sockname] 2]
        set timer [after 10000 "set x timed_out"]
        vwait x
        after cancel $timer
    }
    close $f
    set f [open "|[list [interpreter] $path(script)]" r]
    gets $f
    gets $f listen
    set s [socket 127.0.0.1 $listen]
    set p [fconfigure $s -peername]
    close $s
    close $f
    set l ""
    lappend l [string compare [lindex $p 0] 127.0.0.1]
    lappend l [string compare [lindex $p 2] $listen]
    lappend l [llength $p]

---- Result was:
-1 0 3
---- Result should have been (exact matching):
0 0 3
==== socket-7.1 FAILED


==== socket-7.5 testing socket specific options FAILED
==== Contents of test case:

    set s [socket -server accept 0]
    proc accept {s a p} {
        global x
        set x [fconfigure $s -sockname]
        close $s
    }
    set listen [lindex [fconfigure $s -sockname] 2]
    set s1 [socket 127.0.0.1 $listen]
    set timer [after 10000 "set x timed_out"]
    vwait x
    after cancel $timer
    close $s
    close $s1
    set l ""
    lappend l [lindex $x 0] [expr {[lindex $x 2] ==
$listen}] [llength $x]

---- Result was:
0.0.0.0 1 3
---- Result should have been (exact matching):
127.0.0.1 1 3
==== socket-7.5 FAILED

stringObj.test

==== stringObj-7.3 SetStringFromAny called with
non-string obj FAILED
==== Contents of test case:

    set x 2345
    list [incr x] [testobj objtype $x] [string index $x
end]  [testobj objtype $x]

---- Result was:
2346 wideInt 6 string
---- Result should have been (exact matching):
2346 int 6 string
==== stringObj-7.3 FAILED


==== stringObj-11.1 UpdateStringOfString FAILED
==== Contents of test case:

    set x 2345
    list [string index $x end] [testobj objtype $x]
[incr x]  [testobj objtype $x]

---- Result was:
5 string 2346 wideInt
---- Result should have been (exact matching):
5 string 2346 int
==== stringObj-11.1 FAILED

unixInit.test

==== unixInit-1.2 initialisation: standard channel type
deduction FAILED
==== Contents of test case:

    # pipe1 is a connection to a server that reports
what port it
    # starts on, and delivers a constant string to the
first client to
    # connect to that port before exiting.
    set pipe1 [open "|[list [interpreter]]" r+]
    puts $pipe1 {
        proc accept {channel host port} {
            puts $channel {puts [fconfigure stdin
-peername]; exit}
            close $channel
            exit
        }
        puts [fconfigure [socket -server accept 0]
-sockname]
        vwait forever  }
    # Note the backslash above; this is important to
make sure that the
    # whole string is read before an [exit] can happen...
    flush $pipe1
    set port [lindex [gets $pipe1] 2]
    set sock [socket localhost $port]
    # pipe2 is a connection to a Tcl interpreter that
takes its orders
    # from the socket we hand it (i.e. the server we
create above.)
    # These orders will tell it to print out the
details about the
    # socket it is taking instructions from, hopefully
identifying it
    # as a socket.  Which is what this test is all about.
    set pipe2 [open "|[list [interpreter] <@$sock]" r]
    set result [gets $pipe2]

    # Clear any pending data; stops certain kinds of
(non-important) errors
    fconfigure $pipe1 -blocking 0; gets $pipe1
    fconfigure $pipe2 -blocking 0; gets $pipe2

    # Close the pipes and the socket.
    close $pipe2
    close $pipe1
    catch {close $sock}

    # Can't use normal comparison, as hostname varies
due to some
    # installations having a messed up /etc/hosts file.
    if {
        [string equal 127.0.0.1 [lindex $result 0]] &&
        [string equal $port     [lindex $result 2]]
    } then {
        subst "OK"
    } else {
        subst "Expected: `[list 127.0.0.1 localhost
$port]', Got `$result'"
    }

---- Result was:
Expected: `127.0.0.1 localhost 7716', Got `0.0.0.0
localhost 7716'
---- Result should have been (exact matching):
OK
==== unixInit-1.2 FAILED
dgpplain2003-03-04 04:44:58
Logged In: YES 
user_id=80530


all these failed tests go away
if I build Tcl with the native
compiler for SGI, instead
of with gcc 2.8.1, which 
happened to be installed.

Perhaps the real bug is Tcl's
assumption in an "out of the box"
configuration that it should use gcc?
jenglish Ticket [696854ffff]: 3 changes [History diff]2003-03-04 04:52:34
dgpplain2003-03-04 05:51:41
Logged In: YES 
user_id=80530


Currently when someone does
a default ./configure for Tcl
"out of the box", any compiler
by the name "gcc" will be
favored over the compiler
named "cc", no matter how
old a version of gcc, or how
well-supported gcc is for the
platform.

Seems it would be safer to
use the compiler named "cc"
as a default, since one would
think that it had been configured
locally as the name of the compiler
that local expertise believes works
best.

Of course, the "power users" will
know the right compiler and will
set CC to guide the configuration,
but Tcl gets built by a lot of people
who are not power users, and they
should have something more reliable
"out of the box".
dgp Ticket [696854ffff]: 2 changes [History diff]2003-03-04 05:53:53
jenglishplain2003-03-04 07:13:08
Logged In: YES 
user_id=68433

> Seems it would be safer to
> use the compiler named "cc"
> as a default, since one would
> think that it had been configured
> locally as the name of the compiler
> that local expertise believes works
> best.

That's not always the case, though.  It appears to be true
on AIX and IRIX 6, but on HP-UX 10 (and on the last version
of SunOS I used, which was quite a while ago), "cc" is an
ancient 1970s-era compiler, and the real C compiler is
called something else.

"c89" is probably a safe bet (it's what POSIX.1 specifies,
and works on all the systems I have available except for the
Linux boxes).
dkfplain2003-03-04 16:44:26
Logged In: YES 
user_id=79902

Perhaps the right thing to do would be to document in the
right README that users should have their CC env-var set
correctly before running configure...?
lvirdenplain2003-04-23 21:41:39
Logged In: YES 
user_id=15949

I agree - the assumption that the gcc is good or bad is just
as fragile a decision as the assumption that the cc found is
good or bad.

Perhaps configure should be a bit smarter in its tests, so
that it finds a working c compiler .  Or perhaps the
configure should require the user to specify a c compiler
every time, rather than making a potentially incorrect
assumption.
mdejongplain2003-04-24 02:52:06
Logged In: YES 
user_id=90858

There are a couple of options here:

For 8.4 and earlier
export CC=cc
.../configure ...

For the CVS HEAD.
.../configure CC=cc

Both should work just fine.

The unix README for Tcl already states:

    Note: by default gcc will be used if it can be located
on the PATH.
    if you want to use cc instead of gcc, set the CC
environment variable
    to "cc" before running configure. It is not safe to edit the
    Makefile to use gcc after configure is run. Also note that
    you should use the same compiler when building extensions.


At this point, I just don't see any reason to choose gcc
over cc for every system. If someone can come up with
some tests that gcc fails, I can add them to the configure
script.
mdejongplain2003-05-13 09:51:31
Logged In: YES 
user_id=90858

So, can someone come up with a configure time test that
a gcc compiled executable will fail on but that will work
with cc for this specific platform? If so, then we can add
a test and fail out with a message indicating that the version
of gcc is buggy and that another compiler should be set via
the CC var. If no, I am not sure what else can be done so
I will likely close this bug report soon.
mdejongplain2003-05-21 09:04:04
Logged In: YES 
user_id=90858

I don't see what else can be done here. Closing bug report.
Log in (anonymous is fine) to add a comment.