Fix memcheck/tests/linux/dlclose_leak.c build under -std=gnu90.

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.
This commit is contained in:
Mark Wielaard 2018-01-16 11:08:59 +01:00
parent f8ae2f95d6
commit 400ad0e36e

View 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));