"GOT", but the "O" is a cute, smiling sun Index | Thread

From:
Ted Bullock <tbullock@comlore.com>
Subject:
Build failing on lib/diff_main.c using gcc
To:
gameoftrees@openbsd.org
Date:
Thu, 3 Nov 2022 14:46:25 -0600

Download raw body.

Heyo,

I updated to the latest tree from today and hit a c99 compile warning
that failed the build (line 638) on my sparc64 workstation which
continues to use GCC.

lib/diff_main.c: In function 'diff_result_contains_printable_chunks':
lib/diff_main.c:638: error: 'for' loop initial declaration used outside C99 mode

diff 3462996772bca8558a4b9cf84f8e4113600ae27b /home/tbullock/src/got
blob - 00a42243cafc3f305b117bd3a861bb075aeee435
file + lib/diff_main.c
--- lib/diff_main.c
+++ lib/diff_main.c
@@ -634,8 +634,9 @@ diff_result_contains_printable_chunks(struct diff_resu
 {
 	struct diff_chunk *c;
 	enum diff_chunk_type t;
+	int i;
 
-	for (int i = 0; i < result->chunks.len; i++) {
+	for (i = 0; i < result->chunks.len; i++) {
 		c = &result->chunks.head[i];
 		t = diff_chunk_type(c);
 		if (t == CHUNK_MINUS || t == CHUNK_PLUS)


-- 
Ted Bullock <tbullock@comlore.com>