From:  Tim Rentsch <tr.17687@z991.linuxsc.com>
Date:  27 Oct 2024 12:37:20 Hong Kong Time
Newsgroup:  news.alt119.net/comp.lang.c
Subject:  

Re: constexpr keyword is unnecessary

NNTP-Posting-Host:  null

Vir Campestris  writes:

> 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.

Everyone agrees that all warnings should be fixed.  Where people
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.  (I
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 the
two extremes.  But there are different ideas about where that
point should be.

Whether warnings can or should be turned into errors is a
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.