From: Bart Van Assche Date: Fri, 7 Oct 2011 09:49:44 +0000 (+0000) Subject: perf/tinycc.c: Avoid that clang warns about out-of-bounds accesses for X-Git-Tag: svn/VALGRIND_3_7_0~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8094ca4c4374894fb43c5dae18c6b0f0f39e20b3;p=thirdparty%2Fvalgrind.git perf/tinycc.c: Avoid that clang warns about out-of-bounds accesses for array tab[] and also avoid that clang warns about the formatting flag 'L'. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12114 --- diff --git a/perf/tinycc.c b/perf/tinycc.c index 42ff75fc5c..68c171d639 100644 --- a/perf/tinycc.c +++ b/perf/tinycc.c @@ -2162,7 +2162,7 @@ typedef union CValue { unsigned long long ull; struct CString *cstr; void *ptr; - int tab[1]; + int tab[sizeof(long double) / sizeof(int)]; } CValue; /* value on stack */ @@ -7305,7 +7305,7 @@ char *get_tok_str(int v, CValue *cv) case TOK_CLLONG: case TOK_CULLONG: /* XXX: not quite exact, but only useful for testing */ - sprintf(p, "%Lu", cv->ull); + sprintf(p, "%llu", cv->ull); break; case TOK_CCHAR: case TOK_LCHAR: