Fix clang warnings

This commit is contained in:
Stanislav Gromov 2020-11-19 20:26:39 +07:00
parent dc789353fd
commit 67a5cabb3c
2 changed files with 7 additions and 6 deletions

View File

@ -5674,7 +5674,7 @@ static void compound(int stmt_sameline,int starttok)
error(30,block_start); /* compound block not closed at end of file */ error(30,block_start); /* compound block not closed at end of file */
break; break;
} else { } else {
if (count_stmt>0 && isterminal(lastst)) if (count_stmt>0 && isterminal(lastst)) {
if (matchtoken(tLABEL)) { if (matchtoken(tLABEL)) {
cell val; cell val;
char *name; char *name;
@ -5684,12 +5684,13 @@ static void compound(int stmt_sameline,int starttok)
sym=findloc(name); sym=findloc(name);
/* before issuing a warning, check if the label was previously used (via 'goto') */ /* before issuing a warning, check if the label was previously used (via 'goto') */
if (sym!=NULL && sym->ident==iLABEL && (sym->usage & uREAD)==0) if (sym!=NULL && sym->ident==iLABEL && (sym->usage & uREAD)==0)
error(225); /* unreachable code */ error(225); /* unreachable code */
} else if (lastst==tTERMSWITCH && matchtoken(tRETURN)) { } else if (lastst==tTERMSWITCH && matchtoken(tRETURN)) {
lexpush(); /* push the token so it can be analyzed later */ lexpush(); /* push the token so it can be analyzed later */
} else { } else {
error(225); /* unreachable code */ error(225); /* unreachable code */
} /* if */ } /* if */
} /* if */
statement(&indent,TRUE); /* do a statement */ statement(&indent,TRUE); /* do a statement */
count_stmt++; count_stmt++;
} /* if */ } /* if */

View File

@ -457,7 +457,7 @@ static void readline(unsigned char *line)
* ends with the same multiline string, so that this won't trigger commands: * ends with the same multiline string, so that this won't trigger commands:
* *
* new x[] = "Hello * new x[] = "Hello
* *
* #define X 0 * #define X 0
* "; * ";
* *
@ -608,9 +608,9 @@ static int stripcomment(unsigned char *line)
} else { } else {
if (incommand==2 && *line>' ') { if (incommand==2 && *line>' ') {
/* line starting a command, may need raw strings */ /* line starting a command, may need raw strings */
if (strncmp(line, "#error", 6)==0 || if (strncmp((char*)line,"#error",6)==0 ||
strncmp(line, "#warning", 8)==0 || strncmp((char*)line,"#warning",8)==0 ||
strncmp(line, "#pragma", 7)==0) { strncmp((char*)line,"#pragma",7)==0) {
/* is one of the pre-processor commands with pure raw strings */ /* is one of the pre-processor commands with pure raw strings */
incommand=1; incommand=1;
} else { } else {