From: Mark Wielaard Date: Mon, 21 Nov 2016 08:28:07 +0000 (+0000) Subject: Fix none/tests/pth_2sig.c build with (default) -std=gnu90. X-Git-Tag: svn/VALGRIND_3_13_0~273 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2608a8da6a81b8941cf933c9a57b494fd9b464ce;p=thirdparty%2Fvalgrind.git Fix none/tests/pth_2sig.c build with (default) -std=gnu90. error: ‘for’ loop initial declarations are only allowed in C99 mode git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16148 --- diff --git a/none/tests/pth_2sig.c b/none/tests/pth_2sig.c index f296c75af4..56e6904c01 100644 --- a/none/tests/pth_2sig.c +++ b/none/tests/pth_2sig.c @@ -14,7 +14,8 @@ void *slavethread(void *arg) int main(int argc, char **argv) { - for (int i = 0; i < 10; i++) { + int i; + for (i = 0; i < 10; i++) { pthread_t slave; if (pthread_create(&slave, 0, slavethread, 0)) { perror("pthread_create"); @@ -26,7 +27,7 @@ int main(int argc, char **argv) switch (fork()) { case 0: // child sleep(2); // Should be enough to ensure (some) threads are created - for (int i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++) + for (i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++) ; exit(0); case -1: