Date: Thu, 7 Jan 2021 01:19:02 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Ryan Libby <rlibby@freebsd.org> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: clang vs gcc warning flags Message-ID: <X/ZFZqdxkc3W/LNN@kib.kiev.ua> In-Reply-To: <CAHgpiFxr=E1A3V3WLHdJvhfNBU4Z_DzSYSd9vMKbU1wnEBoXFg@mail.gmail.com> References: <CAHgpiFwK77o3J6Bm_3GAQRGAJz70=n8Z8bqqLirahL_gqXCM3w@mail.gmail.com> <X/YYK46L8Qd2byfr@kib.kiev.ua> <CAHgpiFxr=E1A3V3WLHdJvhfNBU4Z_DzSYSd9vMKbU1wnEBoXFg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 06, 2021 at 01:37:53PM -0800, Ryan Libby wrote: > On Wed, Jan 6, 2021 at 12:06 PM Konstantin Belousov <kostikbel@gmail.com> wrote: > > > > On Wed, Jan 06, 2021 at 11:53:13AM -0800, Ryan Libby wrote: > > > - Wnested-externs I just do not understand. We have specified this > > > warning flag for some 25 years but to me it seems completely without > > > value. I suggest we just delete it. > > I suspect this warning is to flag style(9) violations. > > Which aspect do you mean? I don't see it mentioned explicitly, but I > know some of style(9) is reading between the lines. > > If it's that objects with external linkage should be declared in > headers, I think that doesn't address most of the cases where extern is > actually used in our .c files. It is more of agreement to put declarations with external linkage at top level, not neccessary in headers. But yes, people usually get follow-ups to the commits when something is declared in .c (or did got follow-ups until recent times). And I think this is a reasonable rule for uniformity. I do not believe we have any instance of use of nested function definition in base, and I do not see why would we need this extension. For the same reason, for not being needed, Apple' blocks did not survived (but did damaged our ABI somewhat). > > Maybe the answer should be different for contrib software (where we > don't generally enforce style)? Of course we cannot enforce style(9) on contrib, it is not applicable by any means.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?X/ZFZqdxkc3W/LNN>