Skip to content

Commit

Permalink
Merge pull request #2365 from yebblies/variadicstring
Browse files Browse the repository at this point in the history
[DDMD] Explicitly type result of CondExp as a const char * to avoid passing an array to a c varargs function
  • Loading branch information
AndrejMitrovic committed Jul 19, 2013
2 parents fd8ab00 + ba1970b commit 3ea68ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/expression.c
Expand Up @@ -11525,9 +11525,9 @@ Expression *AssignExp::semantic(Scope *sc)
// Disallow da = sa (Converted to da = sa[])
const char* e1str = e1->toChars();
const char* e2str = e2->toChars();
const char* atypestr = e1->op == TOKslice ? "element-wise" : "slice";
warning("explicit %s assignment %s = (%s)[] is better than %s = %s",
e1->op == TOKslice ? "element-wise" : "slice",
e1str, e2str, e1str, e2str);
atypestr, e1str, e2str, e1str, e2str);
}
e2 = e2->implicitCastTo(sc, e1->type);
}
Expand Down

0 comments on commit 3ea68ad

Please sign in to comment.