]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix memcheck/tests/linux/dlclose_leak.c build under -std=gnu90.
authorMark Wielaard <mark@klomp.org>
Tue, 16 Jan 2018 10:08:59 +0000 (11:08 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 16 Jan 2018 10:08:59 +0000 (11:08 +0100)
Older gcc (4.8) default to GNU C90. Causing:

dlclose_leak.c:14:5: error: ‘for’ loop initial declarations are only
                     allowed in C99 mode

Fix by declaring int i before the loop.

memcheck/tests/linux/dlclose_leak.c

index 329aaced3d7f109d7ebb7602fe0c648539ee7d83..0a8fba37fbc8659e20b9ae0dd791bbc10fdb0662 100644 (file)
@@ -11,7 +11,8 @@ char* (*alloc_1_byte)(void);
 
 int main(int argc, char** argv)
 {
-    for (int i = 0; i < 2; ++i)
+    int i;
+    for (i = 0; i < 2; ++i)
     {
         char* memToLeak;
         char x __attribute__((unused));