On Fri, May 25, 2007 at 07:20:07PM -0700, chromatic wrote:
> On Friday 25 May 2007 18:53:08 [EMAIL PROTECTED] wrote:
> 
> > Modified: trunk/src/objects.c
> > ===========================================================================
> >=== --- trunk/src/objects.c (original)
> > +++ trunk/src/objects.c Fri May 25 18:53:05 2007
> > @@ -40,10 +40,9 @@
> >  INTVAL
> >  Parrot_get_vtable_index(Interp *interp, STRING *name)
> >  {
> > -    char  *name_c = string_to_cstring(interp, name);
> > +    const char * const name_c = string_to_cstring(interp, name);
> >      INTVAL low    = 0;
> >      INTVAL high   = NUM_VTABLE_FUNCTIONS - 1;
> > -    INTVAL i;
> >  
> >      /* some of the first "slots" don't have names. skip 'em. */
> >      while (!Parrot_vtable_slot_names[low]) {
> > @@ -52,16 +51,13 @@
> >      }
> >  
> >      while (low <= high) {
> > -        char *meth_c;
> > -        int   cmp;
> > -
> > -        i      = (low + high) / 2;
> > -        meth_c = Parrot_vtable_slot_names[i];
> > +        const INTVAL i = (low + high) / 2;
> > +        const char * const meth_c = Parrot_vtable_slot_names[i];
> 
> Whoops, that just broke a couple of platforms.  As I understand it, some 
> picky 
> compilers only allow simultaneous declarations and assignments at the start 
> of a function, not within any block.

They wouldn't be C89 conformant if they forbid *that*.

It may be something to do with the const *char const, what type "" string
constants have (according to the particular compiler) and how fussy it is.

And we found bugs in (at least) Borland's compiler to do with this sort of
thing.

Nicholas Clark

Reply via email to