aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Doolittle <ldoolitt@recycle.lbl.gov>2017-05-08 21:56:38 -0700
committerLarry Doolittle <ldoolitt@recycle.lbl.gov>2017-05-08 21:56:38 -0700
commit3c0a73822dd173b47ac5c04935b64af552093a44 (patch)
treebcf2670363b8861340d524ec7b36b92c359e215e
parentdfb75d9b6ccbf57fe2ec2768a118224034d72829 (diff)
downloadtinycc-3c0a73822dd173b47ac5c04935b64af552093a44.tar.gz
tinycc-3c0a73822dd173b47ac5c04935b64af552093a44.tar.bz2
Give clang one less thing to complain about
"s"[i<2] and "s" + (i<2) are literally identical, but the latter triggers a warning from clang because it looks so much like a noob is trying to concatenate an integer and a string. The former is arguably more clear.
-rw-r--r--tccpe.c2
-rw-r--r--tcctools.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/tccpe.c b/tccpe.c
index 1337de8..cecdd37 100644
--- a/tccpe.c
+++ b/tccpe.c
@@ -965,7 +965,7 @@ static void pe_build_exports(struct pe_info *pe)
} else {
fprintf(op, "LIBRARY %s\n\nEXPORTS\n", dllname);
if (pe->s1->verbose)
- printf("<- %s (%d symbol%s)\n", buf, sym_count, "s" + (sym_count < 2));
+ printf("<- %s (%d symbol%s)\n", buf, sym_count, "s"[sym_count < 2]);
}
#endif
diff --git a/tcctools.c b/tcctools.c
index 55050ad..34cefa1 100644
--- a/tcctools.c
+++ b/tcctools.c
@@ -390,7 +390,7 @@ usage:
}
if (v)
- printf("<- %s (%d symbol%s)\n", outfile, i, "s" + (i<2));
+ printf("<- %s (%d symbol%s)\n", outfile, i, "s"[i<2]);
ret = 0;