Fix format-string bugs by adding __attribute__((__format__)) in all applicable

places and fixing all warnings my gcc produced.
Among other things, this should fix several segfaults (including one I just
ran into).
This commit is contained in:
Frits van Bommel
2009-05-17 00:15:25 +02:00
parent 392a4a850e
commit 76ae0b0ab6
15 changed files with 56 additions and 31 deletions

View File

@@ -240,7 +240,7 @@ LLConstant* DtoConstArrayInitializer(ArrayInitializer* arrinit)
// make sure the number of initializers is sane
if (arrinit->index.dim > arrlen || arrinit->dim > arrlen)
{
error(arrinit->loc, "too many initializers, %d, for array[%d]", arrinit->index.dim, arrlen);
error(arrinit->loc, "too many initializers, %u, for array[%zu]", arrinit->index.dim, arrlen);
fatal();
}
@@ -273,7 +273,7 @@ LLConstant* DtoConstArrayInitializer(ArrayInitializer* arrinit)
// error check from dmd
if (initvals[j] != NULL)
{
error(arrinit->loc, "duplicate initialization for index %d", j);
error(arrinit->loc, "duplicate initialization for index %zu", j);
}
LLConstant* c = DtoConstInitializer(val->loc, elemty, val);