NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/57723: -Wmisleading-indentation can warn incorrectly



> Date: Fri, 24 Nov 2023 19:20:00 +0000 (UTC)
> From: Mouse <mouse%Rodents-Montreal.ORG@localhost>
> 
> 	gcc -Wmisleading-indentation warns about certain
> 	correctly-indented statements.  To cite the example I noticed
> 	this with:
> 
> 	buffer.c: In function 'DelBuf':
> 	"buffer.c", line 462:5: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
> 	   { for (p=buffers;p&&(p->kind!=BUF_FILE);p=p->next) ;
> 	     ^~~
> 	"buffer.c", line 463:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
> 	     if (p == 0) p = buffers ? buffers : NewBf_c("main");
> 	     ^~

This looks like a matter with gcc in general, not with NetBSD's
version of it, no?

(In NetBSD's source code, this style is against KNF, so it _would_ be
appropriate to warn about this code, although that's not quite the
nature of what's happening here.)


Home | Main Index | Thread Index | Old Index