[cfe-commits] patch: add flag to warn_redecl_library_builtin

Richard Smith richard at metafoo.co.uk
Wed Jan 23 19:41:07 PST 2013


On Wed, Jan 23, 2013 at 6:27 PM, Nick Lewycky <nlewycky at google.com> wrote:
> On 22 December 2012 16:34, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>>
>> Hi Nick,
>>
>> On Fri, Dec 21, 2012 at 11:01 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
>> > The attached patch adds a flag to control warn_redecl_library_builtin,
>> > -Wlibrary-redeclaration. I also update Misc/warning-flags.c. Please
>> > review!
>>
>> Seems like the point of this review is to bikeshed on the warninig
>> group name, so, here goes.
>
>
> More or less. I was hoping a clang code owner would express an opinion, and
> that's what I would commit.
>
> Nick
>
>>
>>
>> -Wlibrary-redeclaration seems to suggest that we will warn on any
>> redecl of a library function, like "it'd be better to use #include
>> <foo.h> instead of declaring foo() directly".  I'd suggest
>> -Wincompatible-library-redeclaration or -Wbad-library-redeclaration.

Hmm, gcc uses e.g. -fno-builtin-memset to disable this warning, but
that doesn't seem like a very attractive option.
-Wincompatible-library-redeclaration SGTM.



More information about the cfe-commits mailing list