"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Tracey Emery <tracey@traceyemery.net>
Subject:
Re: Build failing on lib/diff_main.c using gcc
To:
Ted Bullock <tbullock@comlore.com>, gameoftrees@openbsd.org
Date:
Thu, 3 Nov 2022 15:53:21 -0600

Download raw body.

Thread
On Thu, Nov 03, 2022 at 10:43:46PM +0100, Stefan Sperling wrote:
> On Thu, Nov 03, 2022 at 02:46:25PM -0600, Ted Bullock wrote:
> > 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
> > 
> 
> Thanks, committed. This went unnoticed during review of recent diff.git
> changes. I will patch up the devel/got port as well to make it allow
> it to build on OpenBSD/sparc64.
> 
> It would be nice if someone could run util/got-build-regress.sh on
> a sparc64 machine once per day. That would have caught this problem
> weeks ago. I used to do this but I no longer have any sparc64 left.

I can look at that when I get back.

> 
> > 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>
> > 
> > 
> 

-- 

Tracey Emery