Article View: gnu.g++.bug
Article #1168Patch for libg++-2.3/libg++/etc/trie-gen/compact.cc
From: Jeff Smith
Date: Wed, 23 Dec 1992 17:46
Date: Wed, 23 Dec 1992 17:46
70 lines
3065 bytes
3065 bytes
The following patch applies to libg++-2.3/libg++/etc/trie-gen/compact.cc
and fixes a problem with statements of the form printf("...",i,++i) which
genberate results that are dependent on the order in which the arguments
are evaluated.
This bug also affects at least libg++-2.2.
*** xcompact.cc Tue Dec 1 00:57:07 1992
--- compact.cc Wed Dec 23 17:35:22 1992
***************
*** 303,310 ****
max_number < MAX_UNSIGNED_CHAR ? "char" : max_number < MAX_UNSIGNED_SHORT ? "short" : "int",
current_rows);
! for (i = 0; i < current_rows; )
! printf ("%*d,%s", field_width, row_offsets[i], ++i % COL_WIDTH ? " " : "\n ");
max_number = 0;
--- 303,310 ----
max_number < MAX_UNSIGNED_CHAR ? "char" : max_number < MAX_UNSIGNED_SHORT ? "short" : "int",
current_rows);
! for (i = 0; i < current_rows; i++ )
! printf ("%*d,%s", field_width, row_offsets[i], (i+1) % COL_WIDTH ? " " : "\n ");
max_number = 0;
***************
*** 319,326 ****
max_number < MAX_UNSIGNED_CHAR ? "char" : max_number < MAX_UNSIGNED_SHORT ? "short" : "int",
compressed_len + 1);
! for (i = 0; i < compressed_len + 1; )
! printf ("%*d,%s", field_width, checks[i], ++i % COL_WIDTH ? " " : "\n ");
max_number = 0;
--- 319,326 ----
max_number < MAX_UNSIGNED_CHAR ? "char" : max_number < MAX_UNSIGNED_SHORT ? "short" : "int",
compressed_len + 1);
! for (i = 0; i < compressed_len + 1; i++)
! printf ("%*d,%s", field_width, checks[i], (i+1) % COL_WIDTH ? " " : "\n ");
max_number = 0;
***************
*** 335,342 ****
max_number < MAX_SIGNED_CHAR ? "char" : max_number < MAX_SIGNED_SHORT ? "short" : "int",
compressed_len + 1);
! for (i = 0; i <= compressed_len; )
! printf ("%*d,%s", field_width, values[i], ++i % COL_WIDTH ? " " : "\n ");
printf ("\n};\n\n");
}
--- 335,342 ----
max_number < MAX_SIGNED_CHAR ? "char" : max_number < MAX_SIGNED_SHORT ? "short" : "int",
compressed_len + 1);
! for (i = 0; i <= compressed_len; i++ )
! printf ("%*d,%s", field_width, values[i], (i+1) % COL_WIDTH ? " " : "\n ");
printf ("\n};\n\n");
}
--
Jeff Smith, Computer Science, Warwick University, Coventry, CV4 7AL, England
jeff@dcs.warwick.ac.uk phone: +44 203 523485 fax: +44 203 525714
Technical Details
Message-ID:
<1992Dec23.174624.25954@dcs.warwick.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!dcs.warwick.ac.UK!jeffShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!dcs.warwick.ac.UK!jeff From: jeff@dcs.warwick.ac.UK (Jeff Smith) Subject: Patch for libg++-2.3/libg++/etc/trie-gen/compact.cc Message-ID: <1992Dec23.174624.25954@dcs.warwick.ac.uk> Sender: gnulists@ai.mit.edu Organization: Department of Computer Science, Warwick University, England Distribution: gnu Date: Wed, 23 Dec 1992 17:46:24 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 71