home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / g / bug / 2078 < prev    next >
Encoding:
Text File  |  1992-12-23  |  2.9 KB  |  84 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!dcs.warwick.ac.UK!jeff
  3. From: jeff@dcs.warwick.ac.UK (Jeff Smith)
  4. Subject: Patch for libg++-2.3/libg++/etc/trie-gen/compact.cc
  5. Message-ID: <1992Dec23.174624.25954@dcs.warwick.ac.uk>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Department of Computer Science, Warwick University, England
  8. Distribution: gnu
  9. Date: Wed, 23 Dec 1992 17:46:24 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 71
  12.  
  13. The following patch applies to libg++-2.3/libg++/etc/trie-gen/compact.cc
  14. and fixes a problem with statements of the form printf("...",i,++i) which
  15. genberate results that are dependent on the order in which the arguments
  16. are evaluated.
  17.  
  18. This bug also affects at least libg++-2.2.
  19.  
  20. *** xcompact.cc    Tue Dec  1 00:57:07 1992
  21. --- compact.cc    Wed Dec 23 17:35:22 1992
  22. ***************
  23. *** 303,310 ****
  24.             max_number < MAX_UNSIGNED_CHAR ? "char" : max_number < MAX_UNSIGNED_SHORT ? "short" : "int",
  25.             current_rows);
  26.         
  27. !   for (i = 0; i < current_rows; )
  28. !     printf ("%*d,%s", field_width, row_offsets[i], ++i % COL_WIDTH ? " " : "\n  ");
  29.         
  30.     max_number = 0;
  31.   
  32. --- 303,310 ----
  33.             max_number < MAX_UNSIGNED_CHAR ? "char" : max_number < MAX_UNSIGNED_SHORT ? "short" : "int",
  34.             current_rows);
  35.         
  36. !   for (i = 0; i < current_rows; i++ )
  37. !     printf ("%*d,%s", field_width, row_offsets[i], (i+1) % COL_WIDTH ? " " : "\n  ");
  38.         
  39.     max_number = 0;
  40.   
  41. ***************
  42. *** 319,326 ****
  43.             max_number < MAX_UNSIGNED_CHAR ? "char" : max_number < MAX_UNSIGNED_SHORT ? "short" : "int",
  44.             compressed_len + 1);
  45.         
  46. !   for (i = 0; i < compressed_len + 1; )
  47. !     printf ("%*d,%s", field_width, checks[i], ++i % COL_WIDTH ? " " : "\n  ");
  48.         
  49.     max_number = 0;
  50.   
  51. --- 319,326 ----
  52.             max_number < MAX_UNSIGNED_CHAR ? "char" : max_number < MAX_UNSIGNED_SHORT ? "short" : "int",
  53.             compressed_len + 1);
  54.         
  55. !   for (i = 0; i < compressed_len + 1; i++)
  56. !     printf ("%*d,%s", field_width, checks[i], (i+1) % COL_WIDTH ? " " : "\n  ");
  57.         
  58.     max_number = 0;
  59.   
  60. ***************
  61. *** 335,342 ****
  62.             max_number < MAX_SIGNED_CHAR ? "char" : max_number < MAX_SIGNED_SHORT ? "short" : "int",
  63.             compressed_len + 1);
  64.         
  65. !   for (i = 0; i <= compressed_len; )
  66. !     printf ("%*d,%s", field_width, values[i], ++i % COL_WIDTH ? " " : "\n  ");
  67.         
  68.     printf ("\n};\n\n");
  69.   }
  70. --- 335,342 ----
  71.             max_number < MAX_SIGNED_CHAR ? "char" : max_number < MAX_SIGNED_SHORT ? "short" : "int",
  72.             compressed_len + 1);
  73.         
  74. !   for (i = 0; i <= compressed_len; i++ )
  75. !     printf ("%*d,%s", field_width, values[i], (i+1) % COL_WIDTH ? " " : "\n  ");
  76.         
  77.     printf ("\n};\n\n");
  78.   }
  79.  
  80. -- 
  81. Jeff Smith, Computer Science, Warwick University, Coventry, CV4 7AL, England
  82. jeff@dcs.warwick.ac.uk  phone: +44 203 523485   fax: +44 203 525714
  83.  
  84.