From:  Thiago Adams <thiago.adams@gmail.com>
Date:  28 Oct 2024 19:58:26 Hong Kong Time
Newsgroup:  news.alt119.net/comp.lang.c
Subject:  

Re: constexpr keyword is unnecessary

NNTP-Posting-Host:  null

On 28/10/2024 03:13, Kaz Kylheku wrote:
> On 2024-10-26, James Kuyper  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 believe warnings in code should be treated as alarms that require 
acknowledgment.

For instance,

const unsigned char ch = 1234;

GCC:
warning: unsigned conversion from 'int' to 'unsigned char' changes value 
from '1234' to '210' [-Woverflow]

The programmer might intend this behavior; in that case, the "alarm" 
should be acknowledged.

I would like a portable (standardized) way to achieve this.