From patchwork Sat Jun 23 19:51:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 933762 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41CmJt6Szzz9s4V for ; Sun, 24 Jun 2018 05:51:10 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751838AbeFWTvF (ORCPT ); Sat, 23 Jun 2018 15:51:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48818 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751684AbeFWTvE (ORCPT ); Sat, 23 Jun 2018 15:51:04 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9ED2830820C3 for ; Sat, 23 Jun 2018 19:51:04 +0000 (UTC) Received: from [IPv6:::1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6ADDD1895C for ; Sat, 23 Jun 2018 19:51:04 +0000 (UTC) To: "linux-ext4@vger.kernel.org" From: Eric Sandeen Subject: [PATCH] libext2fs: remove c99 idiom to fix build Message-ID: <339a1ea1-64a5-1d71-346e-5bfdd8c110f7@redhat.com> Date: Sat, 23 Jun 2018 14:51:03 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sat, 23 Jun 2018 19:51:04 +0000 (UTC) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org hashmap.c: In function ‘ext2fs_hashmap_free’: hashmap.c:72:2: error: ‘for’ loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < h->size; ++i) { ^ hashmap.c:72:2: note: use option -std=c99 or -std=gnu99 to compile your code make[2]: *** [hashmap.o] Error 1 Signed-off-by: Eric Sandeen diff --git a/lib/ext2fs/hashmap.c b/lib/ext2fs/hashmap.c index ade5d89..3d8ee81 100644 --- a/lib/ext2fs/hashmap.c +++ b/lib/ext2fs/hashmap.c @@ -69,7 +69,9 @@ void *ext2fs_hashmap_iter_in_order(struct ext2fs_hashmap *h, void ext2fs_hashmap_free(struct ext2fs_hashmap *h) { - for (size_t i = 0; i < h->size; ++i) { + size_t i; + + for (i = 0; i < h->size; ++i) { struct ext2fs_hashmap_entry *it = h->entries[i]; while (it) { struct ext2fs_hashmap_entry *tmp = it->next;