[#5218] Ruby Book Eng tl, ch1 question — Jon Babcock <jon@...>

13 messages 2000/10/02

[#5404] Object.foo, setters and so on — "Hal E. Fulton" <hal9000@...>

OK, here is what I think I know.

14 messages 2000/10/11

[#5425] Ruby Book Eng. tl, 9.8.11 -- seishitsu ? — Jon Babcock <jon@...>

18 messages 2000/10/11
[#5427] RE: Ruby Book Eng. tl, 9.8.11 -- seishitsu ? — OZAWA -Crouton- Sakuro <crouton@...> 2000/10/11

At Thu, 12 Oct 2000 03:49:46 +0900,

[#5429] Re: Ruby Book Eng. tl, 9.8.11 -- seishitsu ? — Jon Babcock <jon@...> 2000/10/11

Thanks for the input.

[#5432] Re: Ruby Book Eng. tl, 9.8.11 -- seishitsu ? — Yasushi Shoji <yashi@...> 2000/10/11

At Thu, 12 Oct 2000 04:53:41 +0900,

[#5516] Re: Some newbye question — ts <decoux@...>

>>>>> "D" == Davide Marchignoli <marchign@di.unipi.it> writes:

80 messages 2000/10/13
[#5531] Re: Some newbye question — matz@... (Yukihiro Matsumoto) 2000/10/14

Hi,

[#5544] Re: Some newbye question — Davide Marchignoli <marchign@...> 2000/10/15

On Sat, 14 Oct 2000, Yukihiro Matsumoto wrote:

[#5576] Re: local variables (nested, in-block, parameters, etc.) — Dave Thomas <Dave@...> 2000/10/16

matz@zetabits.com (Yukihiro Matsumoto) writes:

[#5617] Re: local variables (nested, in-block, parameters, etc.) — "Brian F. Feldman" <green@...> 2000/10/16

Dave Thomas <Dave@thomases.com> wrote:

[#5705] Dynamic languages, SWOT ? — Hugh Sasse Staff Elec Eng <hgs@...>

There has been discussion on this list/group from time to time about

16 messages 2000/10/20
[#5712] Re: Dynamic languages, SWOT ? — Charles Hixson <charleshixsn@...> 2000/10/20

Hugh Sasse Staff Elec Eng wrote:

[#5882] [RFC] Towards a new synchronisation primitive — hipster <hipster@...4all.nl>

Hello fellow rubyists,

21 messages 2000/10/26

[ruby-talk:5709] build warning...

From: Josh Huber <huber@...>
Date: 2000-10-20 12:59:50 UTC
List: ruby-talk #5709
My primary platform is powerpc, and I'm really used to seeing:
'Comparison always true/false due to limited range in data type'

spit out by gcc due to the fact that on x86 (and other LE archs) char
defaults to signed char, but on the ppc (and ARM, don't know about
sparc) char =3D=3D unsigned char.

for example:
void main(void) {
        char t;
        int i =3D -1;
        t =3D i;
        printf("val: %d\n", (int)t);
}

prints
val =3D 255
on powerpc, but
val =3D -1
on intel.

normally this can cause major problems, and I saw this while building
ruby.  the warning was actually in the parser...

line 3520 of parse.y contains is_identchar(tok()[0]).  tok()
(tokenbuf) is a char *, and is_identchar does this:
((int)(c))!=3D-1 ...

of course, this will always be true on ppc systems.

now, I don't think there's really a problem, because I _think_
tokenbuf characters are never set to a negative value. (could be
wrong, but I didn't see any cases).

in any case, a fix is attached.  this would fix future (obscure) bugs,
and at least get rid of that warning.  (that warning is flagged on the
debian buildd for powerpc because it is usually an indication that
something is broken).

Thanks,

--=20
Josh
| huber@mclx.com |
1024D/6B21489A 61F0 6138 BE7B FEBF A223  E9D1 BFE1 2065 6B21 489A

Attachments (1)

ruby-signed-char (493 Bytes, text/plain)
--- ruby-1.6.1/build-tree/ruby-1.6.1/parse.y	Fri Oct 20 08:57:16 2000
+++ parse.y	Fri Oct 20 08:56:31 2000
@@ -1822,7 +1822,7 @@
 
 #define is_identchar(c) (((int)(c))!=-1&&(ISALNUM(c) || (c) == '_' || ismbchar(c)))
 
-static char *tokenbuf = NULL;
+static signed char *tokenbuf = NULL;
 static int   tokidx, toksiz = 0;
 
 static NODE *str_extend();
@@ -2080,7 +2080,7 @@
 
 static void
 tokadd(c)
-    char c;
+    signed char c;
 {
     tokenbuf[tokidx++] = c;
     if (tokidx >= toksiz) {

In This Thread

Prev Next