Sujet : Re: constexpr keyword is unnecessary
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 28. Oct 2024, 07:13:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241027220459.109@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-10-26, James Kuyper <
jameskuyper@alumni.caltech.edu> wrote:
On 10/26/24 10:07, Vir Campestris wrote:
On 22/10/2024 13:48, Thiago Adams wrote:
>
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.
>
I disapprove of that policy. A conforming implementation is free to warn
about anything, even about your failure to use taboo words as
identifiers.
I also follow that and it's been that way pretty much everywhere
I have worked, at least recently.
But not literally like that.
Of course, you control which warnings are in effect, and fix those.
You disable silly warnings you disagree with, rather than fix them.
The business of deciding what diagnostics are going to be used and which
are not is a separate activity. Usually most of the activity in this are
occurs when there is a compiler change, such as an upgrade.
The newer or different compiler offser some diagnostics which trigger in
the code, and for each, the squelch-or-fix decision has to be made.
It's not always an easy decision, because the value, or lack thereof, of
a diagnostic is not always apaprent from one situation in which it goes
off. Some diagnostics can be wortwhile in spite of a significant false
positive rate.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca