[e-lang] E 0.9.3 release?
jleonard at slimy.com
Sun Jan 2 16:49:48 PST 2011
On Sun, Jan 02, 2011 at 04:07:59PM -0800, Mark Miller wrote:
> On Sun, Jan 2, 2011 at 11:36 AM, Bill Frantz <frantz at pwpconsult.com> wrote:
> > On 1/1/11 at 10:12 PM, erights at gmail.com (Mark Miller) wrote:
> > >* New warning: "warning: array subscript has type `char'"
> > >for C code in byacc/j that seems innocent to me. And in any case is old
> > >third party code.
> > Since C supports signed chars (an abomination on the world), a C
> > compiler which actually defaults to signed could cause array
> > underflow problems. YMMV. VWP. Caveat emptor.
> > I would change their declarations to include "unsigned".
> If I saw something that looked like indexing, I would understand. However,
> the warning complains, for example, about the last line of the following
> program fragment. This only happens to me using cygwin gcc on Windows.
> Compiling the same code on my Mac using regular gcc emits no warning.
> void print_pos(char *st_line,char *st_cptr)
> char *s;
> if (st_line == 0) return;
> for (s = st_line; *s != '\n'; ++s)
> if (isprint(*s) || *s == '\t')
The problem is likely to be the implementation of isprint: It is frequently
implemented as a (lightly protected) lookup in an array. The warning would
likely go away if *s were declared or cast unsigned char.
Probably a bug in the isprint implementation, but still a real warning.
More information about the e-lang