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
The following reply was made to PR toolchain/57723; it has been noted by GNATS.
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: Mouse <mouse%Rodents-Montreal.ORG@localhost>
Cc: gnats-bugs%netbsd.org@localhost, toolchain-manager%netbsd.org@localhost,
gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: toolchain/57723: -Wmisleading-indentation can warn incorrectly
Date: Fri, 24 Nov 2023 19:30:26 +0000
> Date: Fri, 24 Nov 2023 19:20:00 +0000 (UTC)
> From: Mouse <mouse%Rodents-Montreal.ORG@localhost>
>=20
> gcc -Wmisleading-indentation warns about certain
> correctly-indented statements. To cite the example I noticed
> this with:
>=20
> buffer.c: In function 'DelBuf':
> "buffer.c", line 462:5: error: this 'for' clause does not guard... [-Wer=
ror=3Dmisleading-indentation]
> { for (p=3Dbuffers;p&&(p->kind!=3DBUF_FILE);p=3Dp->next) ;
> ^~~
> "buffer.c", line 463:5: note: ...this statement, but the latter is misle=
adingly indented as if it were guarded by the 'for'
> if (p =3D=3D 0) p =3D 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