Liste des Groupes | Revenir à cl c |
Vir Campestris <vir.campestris@invalid.invalid> writes:Note that for most code, strict conformance to C standards is not a major concern - most programs are at least somewhat platform specific or compiler-specific. If that is the case, then it is a good thing to use non-standard features if they make the code clearer or open the possibility of more static checking.
On 22/10/2024 13:48, Thiago Adams wrote:Everyone agrees that all warnings should be fixed. Where people
>I think a more generic feature would be to have a standard way of>
promoting selected warnings to errors. This would avoid stacking
features with small differences, such as treating constexpr as a
special case compared to other constant expressions in C.
I have in the past had coding standards that require you to fix all
warnings. After all, sometimes they do matter.
differ is what set of warning conditions should be enabled.
At (or at least near) one end of the spectrum is -pedantic.
At the other end of the spectrum is -Weverything in clang. (IAs I understand it, "-Weverything" was more intended for tests of the compiler than an option anyone should use in practice. More realistic, I think, would be "-Wall -Wextra" which enables several warnings that many people would feel give a lot of hits on perfectly good code.
confess I am sort of assuming that -Weverything includes every
warning condition known to man, which might not be the case. But
I trust people can understand what is meant by "-Weverything".)
I expect most people would advocate a point somewhere between theYes - and there /should/ be different ideas there.
two extremes. But there are different ideas about where that
point should be.
Whether warnings can or should be turned into errors is aAgreed - deciding on the warnings to use is critical.
separate question. The first question is what set of warning
conditions should be enabled. A statement that all warnings
should be fixed is meaningless if there is no indication of
what warning conditions should be enabled.
Les messages affichés proviennent d'usenet.