Merge pull request #177 from Arkshine/fix/clang-3.5-compiler-warning

Compiler: Fix tautological warning with clang-3.5
This commit is contained in:
Vincent Herbet 2015-01-12 00:52:29 +01:00
commit 328c3d7b8b
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) if (parens)
needtoken(')'); needtoken(')');
if (ident==iARRAY || ident==iREFARRAY) { 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 */ error(33,ptr); /* array must be indexed */
} /* if */ } /* if */
if (ident==iCONSTEXPR) { /* constant expression */ if (ident==iCONSTEXPR) { /* constant expression */

View File

@ -1045,10 +1045,10 @@ static int hier13(value *lval)
array1= (lval->ident==iARRAY || lval->ident==iREFARRAY); array1= (lval->ident==iARRAY || lval->ident==iREFARRAY);
array2= (lval2.ident==iARRAY || lval2.ident==iREFARRAY); array2= (lval2.ident==iARRAY || lval2.ident==iREFARRAY);
if (array1 && !array2) { 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 */ error(33,ptr); /* array must be indexed */
} else if (!array1 && array2) { } 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 */ error(33,ptr); /* array must be indexed */
} /* if */ } /* if */
/* ??? if both are arrays, should check dimensions */ /* ??? if both are arrays, should check dimensions */