From f5ee54826e53ba446c85ca8afe15a228bcd8c1a7 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Tue, 19 Oct 2021 07:15:02 +0200 Subject: [PATCH] sfio: correct misleading indentation in SFnputc macro definition MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes errors like this when building with CMake (which uses -Wall, -Wextra and -Werror) on Ubuntu 21.10 with gcc 11.2.0. ../lib/sfio/sfvprintf.c:76:13: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 76 | if(n != w) goto done; n = 0;\ | ^~ ../lib/sfio/sfvprintf.c:511:25: note: in expansion of macro ‘SFnputc’ 511 | SFnputc(f, '0', n); | ^~~~~~~ ../lib/sfio/sfvprintf.c:511:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 511 | SFnputc(f, '0', n); | ^ ../lib/sfio/sfvprintf.c:76:35: note: in definition of macro ‘SFnputc’ 76 | if(n != w) goto done; n = 0;\ | ^ --- lib/sfio/sfvprintf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sfio/sfvprintf.c b/lib/sfio/sfvprintf.c index cbff69349..d997e52e1 100644 --- a/lib/sfio/sfvprintf.c +++ b/lib/sfio/sfvprintf.c @@ -73,7 +73,8 @@ int sfvprintf(Sfio_t * f, const char *form, va_list args) { if((endd-d) >= n) { while(n--) *d++ = (uchar)c; } \ else \ { SFEND(f); n_output += (w = SFNPUTC(f,c,n)) > 0 ? w : 0; SFBUF(f); \ - if(n != w) goto done; n = 0;\ + if(n != w) goto done; \ + n = 0; \ } \ } #define SFwrite(f,s,n) \ -- 2.40.0