]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
perf/tinycc.c: Avoid that clang warns about out-of-bounds accesses for
authorBart Van Assche <bvanassche@acm.org>
Fri, 7 Oct 2011 09:49:44 +0000 (09:49 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 7 Oct 2011 09:49:44 +0000 (09:49 +0000)
array tab[] and also avoid that clang warns about the formatting flag 'L'.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12114

perf/tinycc.c

index 42ff75fc5c72319cdcb834c18e9e3639be037873..68c171d639d2e10d8c88fb3551186eb6f7537513 100644 (file)
@@ -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: