]> granicus.if.org Git - graphviz/commitdiff
sfio: correct misleading indentation in SFnputc macro definition
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 19 Oct 2021 05:15:02 +0000 (07:15 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Thu, 21 Oct 2021 20:58:32 +0000 (22:58 +0200)
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

index cbff693490188d8a49b80436fd05fad68f30c8b6..d997e52e163b1de54aba6e836a956ffa66e6004e 100644 (file)
@@ -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) \