I'm stuck with a C program I'm currently writing in Xcode. After having worked on it for several hours, Xcode suddenly started complaining with the "expected expression" message:
switch(cmd) {
case 'S':
state = sstart;
accpos = accmax = varnum = 0;
inquote = inddstar = false;
break;
case 'L':
char c; // *** expected expression
int i = 0;
bool processed;
while( (c = buff[i++]) != '\0') {
acc[accmax++] = c;
After which Xcode complains that the variable c is not defined whenever c is used.
I have tried "show invisibles" in Xcode to no avail. Compiling the program manually with clang or gcc gives the same error message.
After the preprocessor step, this part of the code looks as follows (obtained with clang -E):
switch(cmd) {
case 'S':
state = sstart;
accpos = accmax = varnum = 0;
inquote = inddstar = 0;
break;
case 'L':
char c;
int i = 0;
_Bool processed;
while( (c = buff[i++]) != '\0') {
acc[accmax++] = c;
so nothing interesting either.
Any ideas? I wrote my last C program 23 years ago so I might have missed something...