summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-09-13 20:02:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-09-13 20:02:51 (GMT)
commit6b9fd91cb423efbab3b7cab0c94f43b7da713024 (patch)
tree72b4631d1d05baa45ed1bc0d0f7566328d1b4973
parent85a5f503faf3afa708eebdd3e4351b06a86422d6 (diff)
downloadtcl-6b9fd91cb423efbab3b7cab0c94f43b7da713024.zip
tcl-6b9fd91cb423efbab3b7cab0c94f43b7da713024.tar.gz
tcl-6b9fd91cb423efbab3b7cab0c94f43b7da713024.tar.bz2
3390638 Workaround broken solaris studio cc optimizer.
Thanks to Wolfgang S. Kechel.
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclUtil.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6fadd37..6911e2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2011-09-13 Don Porter <dgp@users.sourceforge.net>
+ * generic/tclUtil.c: [Bug 3390638] Workaround broken solaris
+ studio cc optimizer. Thanks to Wolfgang S. Kechel.
+
* generic/tclDTrace.d: [Bug 3405652] Portability workaround for
broken system DTrace support. Thanks to Dagobert Michelson.
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 19332c8..b327b99 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -2160,7 +2160,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. */
sprintf(buffer, "%ld", n);
return strlen(buffer);
}