On 5/17/07, chromatic <[EMAIL PROTECTED]> wrote:
On Thursday 17 May 2007 09:32:01 jerry gay wrote:
> this revision breaks parrot on msvc (and i suspect other c89-compliant
> compilers--sometimes i wonder if there are any others!)
I doubt even MSVC is C89-compliant, to be honest. It just barfs more often
than GCC on certain things.
> this situation is *extremely* frustrating. the temporary workaround is
> to revert this patch until it works everywhere. the solution is to
> find a way to make gcc (and other) compilers comply with our most
> important coding standard: C89 compliance.
Unfortunately, our headers (and even some system headers) don't follow C89:
then what the heck does c89 compliance mean for parrot, if it's beyond
our control because we can't change system headers? i mean, how do you
enforce that compliance, if the compiler can't do it for you? maybe
this is a case where "almost" is good enough--i don't know.
$ make parrot
compilers/imcc/pbc.c
In file included from ./include/parrot/parrot.h:30,
from compilers/imcc/imc.h:21,
from compilers/imcc/pbc.c:7:
./include/parrot/config.h:82: warning: ISO C90 does not support 'long long'
./include/parrot/config.h:83: warning: ISO C90 does not support 'long long'
In file included from ./include/parrot/atomic.h:25,
from ./include/parrot/thread.h:20,
from ./include/parrot/pmc.h:19,
from ./include/parrot/parrot.h:282,
from compilers/imcc/imc.h:21,
from compilers/imcc/pbc.c:7:
./include/parrot/atomic/gcc_x86.h:30: error: expected '=', ',', ';', 'asm'
or '__attribute__' before 'static'
./include/parrot/atomic/gcc_x86.h:85: error: expected '=', ',', ';', 'asm'
or '__attribute__' before 'static
Chasing down that problem is... fun.
Regardless, does this patch fix the problem for you?
yes, it does. seems i had blinders on, and missed the assignment
statement on the line above.
@@ -918,7 +918,7 @@
char *s = s_key;
*s = 0;
- SymReg *reg = key_reg->set == 'K' ? key_reg->nextkey : key_reg;
+ reg = key_reg->set == 'K' ? key_reg->nextkey : key_reg;
for (key_length = 0; reg ; reg = reg->nextkey, key_length++) {
if ((pc - key - 2) >= KEYLEN)
somehow i missed C<*s = 0;>, which made the declaration illegal. i'm
not used to looking at code with '=' sign alignment, maybe that's what
threw me off. anyway, it was a stupid mistake on my part.
however... why is 's' nulled out, directly after it's initialized to
's_key'? that looks funny.
i've applied as r18580, thanks for the fix.
~jerry