🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.lib.bug
Article #481

Strange Sun 3 problem

#481
From: Doug Schmidt
Date: Wed, 22 Mar 1989 22:21
102 lines
3165 bytes
I'm getting an inconsistency when running the following program
on a sun 4 versus a sun 3 using g++ 1.34 and libg++ 1.34.
Here's the code:

----------------------------------------
#include <stream.h>

main()
{                                        
 char alpha[] = "abcdefghijklmnopqrstuvwxyz";
 int  sz = strlen(alpha);
 cout << "length-of(alpha) = " << sz << "\n \n"; 

 for (int i=0; i<sz; i++){
   char ch = alpha[i];
   cout << "`"     << ch       << "'"
        << " = "   << int(ch)
        << " = O"  << oct(ch)
        << " = Ox" << hex(ch)  << "\n";
 }

} /* end of main */
----------------------------------------

On the Sun 3, here are the (incorrect) results:

------------------------------
length-of(alpha) = 26

`a' = 97 = O141 = Ox41
`b' = 98 = O142 = Ox42
`c' = 99 = O143 = Ox43
`d' = 100 = O144 = Ox44
`e' = 101 = O145 = Ox45
`f' = 102 = O146 = Ox46
`g' = 103 = O147 = Ox47
`h' = 104 = O150 = Ox50
`i' = 105 = O151 = Ox51
`j' = 106 = O152 = Ox52
`k' = 107 = O153 = Ox53
`l' = 108 = O154 = Ox54
`m' = 109 = O155 = Ox55
`n' = 110 = O156 = Ox56
`o' = 111 = O157 = Ox57
`p' = 112 = O160 = Ox60
`q' = 113 = O161 = Ox61
`r' = 114 = O162 = Ox62
`s' = 115 = O163 = Ox63
`t' = 116 = O164 = Ox64
`u' = 117 = O165 = Ox65
`v' = 118 = O166 = Ox66
`w' = 119 = O167 = Ox67
`x' = 120 = O170 = Ox70
`y' = 121 = O171 = Ox71
`z' = 122 = O172 = Ox72
------------------------------

Here's the correct Sun 4 result
----------------------------------------
length-of(alpha) = 26
 
 `a' = 97 = O141 = Ox61
 `b' = 98 = O142 = Ox62
 `c' = 99 = O143 = Ox63
 `d' = 100 = O144 = Ox64
 `e' = 101 = O145 = Ox65
 `f' = 102 = O146 = Ox66
 `g' = 103 = O147 = Ox67
 `h' = 104 = O150 = Ox68
 `i' = 105 = O151 = Ox69
 `j' = 106 = O152 = Ox6a
 `k' = 107 = O153 = Ox6b
 `l' = 108 = O154 = Ox6c
 `m' = 109 = O155 = Ox6d
 `n' = 110 = O156 = Ox6e
 `o' = 111 = O157 = Ox6f
 `p' = 112 = O160 = Ox70
 `q' = 113 = O161 = Ox71
 `r' = 114 = O162 = Ox72
 `s' = 115 = O163 = Ox73
 `t' = 116 = O164 = Ox74
 `u' = 117 = O165 = Ox75
 `v' = 118 = O166 = Ox76
 `w' = 119 = O167 = Ox77
 `x' = 120 = O170 = Ox78
 `y' = 121 = O171 = Ox79
 `z' = 122 = O172 = Ox7a
---------------------------------------- 

Can anyone tell me whether this is a sun3 specific problem (i.e., does
it occur on the VAX), and whether it shows a problem with g++, libg++,
or my installation!!

thanks,

        Doug
--
schmidt@ics.uci.edu | On a clear day, under blue skies, one need not seek
office:             | And asking about Buddha 
(714) 856-4043      | Is like proclaiming innocence,
                    | With loot in your pocket.
Technical Details
Message-ID: <10211@paris.ics.uci.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!ucbvax!decwrl!labrea!rutgers!ucla-cs!uci-ics!zola.ics.uci.edu!schmidt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!ucbvax!decwrl!labrea!rutgers!ucla-cs!uci-ics!zola.ics.uci.edu!schmidt
From: schmidt@zola.ics.uci.edu (Doug Schmidt)
Newsgroups: gnu.g++.lib.bug
Subject: Strange Sun 3 problem
Message-ID: <10211@paris.ics.uci.edu>
Date: 22 Mar 89 22:21:56 GMT
Sender: news@paris.ics.uci.edu
Reply-To: Doug Schmidt <schmidt@zola.ics.uci.edu>
Distribution: gnu
Organization: University of California at Irvine: ICS Dept.
Lines: 102