Re: [PATCH 0/7] Silence even more W=2 warnings
From: Borislav Petkov
Date: Thu Sep 25 2014 - 04:27:16 EST
On Tue, Sep 23, 2014 at 08:43:17PM +0000, Rustad, Mark D wrote:
> Well, please consider the specifics. The entire syscall table is initialized
> with a constant pattern to be sure that every item is initialized. Then each
> syscall is initialized into its proper place. The compiler is complaining that
> entries are being initialized twice.
> Most of the time, that is not done, and so it may catch a patch foulup or
> something. In this particular case, it is normal and intended. There is
> nothing wrong, so there is no reason to throw a warning for every single
> entry in the table. Which is what happens with clang today.
> So the code is correct, but in general the warning can reveal certain issues.
> Just not in this particular usage. This happens to be a warning specific to
> clang at the moment.
Well, I read this as clang is wrong. It looks like the compiler is
unable to understand a perfectly valid usage so it throws a warning. If
we go and fix it in the kernel, we'll be wagging the dog, so to speak.
Which is a no-no obviously.
> That is why it would be more than reasonable for checkpatch to warn on the
> macro introductions. It is certainly a more significant thing than a
> line > 80 characters.
No sorry - I don't agree here. So now you're proposing of adding the
macros *and* checkpatch to warn about them. That's a really wrong thing
to do on so many levels.
> Most of the time, it is new instances of warnings that are most likely to
> reveal a problem. Hiding them in a flood of "normal" warnings prevents
> them from ever being seen. And that is a shame.
Sorry, I can only suggest grepping here and also using what Geert
suggested. There's simply no justification IMO to add code to the kernel
for solely silencing warnings.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/