summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-09-13 20:03:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-09-13 20:03:34 (GMT)
commit3d2e1cceb46e104ca8ecdac157dd4c083a207f8c (patch)
tree8ce021e431f45aeac3d1d0860a7f30d7d819445b /generic/tclUtil.c
parentcb64602c984b5e2475fbbefc24d9d05c23e786f0 (diff)
parenteba0aa0b63589c49ebad74cf7f784cc39afb5ef1 (diff)
downloadtcl-3d2e1cceb46e104ca8ecdac157dd4c083a207f8c.zip
tcl-3d2e1cceb46e104ca8ecdac157dd4c083a207f8c.tar.gz
tcl-3d2e1cceb46e104ca8ecdac157dd4c083a207f8c.tar.bz2
3390638 Workaround broken solaris studio cc optimizer.
Thanks to Wolfgang S. Kechel.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index eaa7eae..5119456 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3165,7 +3165,8 @@ TclFormatInt(buffer, n)
* negating it produces the same value.
*/
- if (n == -n) {
+ intVal = -n; /* [Bug 3390638] Workaround for*/
+ if (n == -n || intVal == n) { /* broken compiler optimizers. */
return sprintf(buffer, "%ld", n);
}