Mercurial > projects > ldc
comparison gen/arrays.cpp @ 1372:229e02867307
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).
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 17 May 2009 00:15:25 +0200 |
parents | 15e9762bb620 |
children | 44c8eef6e6ee |
comparison
equal
deleted
inserted
replaced
1371:967d28b7febe | 1372:229e02867307 |
---|---|
238 } | 238 } |
239 | 239 |
240 // make sure the number of initializers is sane | 240 // make sure the number of initializers is sane |
241 if (arrinit->index.dim > arrlen || arrinit->dim > arrlen) | 241 if (arrinit->index.dim > arrlen || arrinit->dim > arrlen) |
242 { | 242 { |
243 error(arrinit->loc, "too many initializers, %d, for array[%d]", arrinit->index.dim, arrlen); | 243 error(arrinit->loc, "too many initializers, %u, for array[%zu]", arrinit->index.dim, arrlen); |
244 fatal(); | 244 fatal(); |
245 } | 245 } |
246 | 246 |
247 // get elem type | 247 // get elem type |
248 Type* elemty = arrty->nextOf(); | 248 Type* elemty = arrty->nextOf(); |
271 assert(val); | 271 assert(val); |
272 | 272 |
273 // error check from dmd | 273 // error check from dmd |
274 if (initvals[j] != NULL) | 274 if (initvals[j] != NULL) |
275 { | 275 { |
276 error(arrinit->loc, "duplicate initialization for index %d", j); | 276 error(arrinit->loc, "duplicate initialization for index %zu", j); |
277 } | 277 } |
278 | 278 |
279 LLConstant* c = DtoConstInitializer(val->loc, elemty, val); | 279 LLConstant* c = DtoConstInitializer(val->loc, elemty, val); |
280 assert(c); | 280 assert(c); |
281 if (c->getType() != llelemty) | 281 if (c->getType() != llelemty) |