+2  A: 

In C you can only declare a variable at the start of a block. Your line:

Integer *i = (Integer *)v->innerValue;

tries to declare a variable i, but it is not at the start of a block. You can fix this just by opening a block:

case INTEGER:
{
    Integer *i = (Integer *)v->innerValue;
    return i->value % hash->capacity;
}

...and similar for the other cases.

caf
Really? I've never had trouble with this before... Consider the "for" loop in the "case STRING" portion-- that declaration isn't at the beginning of a block either. But I'll definitely try and see what happens.
Platinum Azure
Well, I'll be. That was it. Thanks very much. +1 and check mark for you.
Platinum Azure
You are talking about C89 -- in C99, you can define variables anywhere in a code block, just as you can in C++.
Jonathan Leffler
+3  A: 

You can't declare a variable inside a case block.

That's not entirely true actually. See here. Should help you clear things up.

theycallmemorty
Very informative. I never knew that-- that is so weird. I really wish gcc would have made that point clear, but I've learned long ago that gcc is hardly ever verbose even if it is always correct. Thanks for the reply.
Platinum Azure
There's nothing weird about it if you think about `case` as what it really is. It's not a block, it's just a label, for which `switch` is a computed `goto`. That's why a `case` can be located inside a `while` loop, for example, so long as that `while` loop is within `switch` (and hence we get to Duff's device).
Pavel Minaev