Compiler: Fix tautological warning with clang-3.5

This commit is contained in:
Arkshine 2015-01-11 23:09:53 +01:00
parent dfbc74dc5f
commit a0cfa59e56
2 changed files with 3 additions and 3 deletions

View File

@ -4833,7 +4833,7 @@ static void test(int label,int parens,int invert)
if (parens)
needtoken(')');
if (ident==iARRAY || ident==iREFARRAY) {
char *ptr=(sym->name!=NULL) ? sym->name : "-unknown-";
char *ptr=(sym!=NULL) ? sym->name : "-unknown-";
error(33,ptr); /* array must be indexed */
} /* if */
if (ident==iCONSTEXPR) { /* constant expression */

View File

@ -1045,10 +1045,10 @@ static int hier13(value *lval)
array1= (lval->ident==iARRAY || lval->ident==iREFARRAY);
array2= (lval2.ident==iARRAY || lval2.ident==iREFARRAY);
if (array1 && !array2) {
char *ptr=(lval->sym!=NULL && lval->sym->name!=NULL) ? lval->sym->name : "-unknown-";
char *ptr=(lval->sym!=NULL) ? lval->sym->name : "-unknown-";
error(33,ptr); /* array must be indexed */
} else if (!array1 && array2) {
char *ptr=(lval2.sym!=NULL && lval2.sym->name!=NULL) ? lval2.sym->name : "-unknown-";
char *ptr=(lval2.sym!=NULL) ? lval2.sym->name : "-unknown-";
error(33,ptr); /* array must be indexed */
} /* if */
/* ??? if both are arrays, should check dimensions */