zombieZero
Technical User
I have a proc that converts hex IP address and hex mask into a broadcast address. This worked with TCL 8.3 but I'm hitting a problem with TCL 8.4
Basically, the proc does the following:
set hexIP 80010101
set hexMASK ffff0000
set IPM [expr ( $hexIP | $hexMASK ) ]
-2147352577
format "%08x" $IPM
8001ffff
...Then I convert that value into dotted decimal. This works fine in 8.4 as long as the first octet of the IP address is 128 or higher...if that first bit isn't on, then it fails when the proc is called and nothing is returned.
I put in some debug and found that it is when format is called that it's getting lost...the debug statement after the format never even gets called, as if it somehow got lost somewhere in format itself.
The strange thing is, if I just issue the commands from the shell, it seems to work, but from within the procs themselves it fails every time.
Has anyone else encountered anything like this?
Basically, the proc does the following:
set hexIP 80010101
set hexMASK ffff0000
set IPM [expr ( $hexIP | $hexMASK ) ]
-2147352577
format "%08x" $IPM
8001ffff
...Then I convert that value into dotted decimal. This works fine in 8.4 as long as the first octet of the IP address is 128 or higher...if that first bit isn't on, then it fails when the proc is called and nothing is returned.
I put in some debug and found that it is when format is called that it's getting lost...the debug statement after the format never even gets called, as if it somehow got lost somewhere in format itself.
The strange thing is, if I just issue the commands from the shell, it seems to work, but from within the procs themselves it fails every time.
Has anyone else encountered anything like this?