Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connectionsPath: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Richard Harnden
Newsgroups: comp.lang.c
Subject: Re: constexpr keyword is unnecessary
Date: Tue, 29 Oct 2024 17:26:08 +0000
Organization: A noiseless patient Spider
Lines: 26
Message-ID:
References:
<877ca5q84u.fsf@nosuchdomain.example.com>
<87y12jpxvl.fsf@nosuchdomain.example.com>
<87plnvpgb9.fsf@nosuchdomain.example.com>
<20241027220459.109@kylheku.com>
Reply-To: nospam.harnden@invalid.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 29 Oct 2024 18:26:09 +0100 (CET)
Injection-Info: dont-email.me; posting-host="127420d604711db7f3817827c2aadaff";
logging-data="1734780"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19K9/1LZ1KIKWPYjPvs31f3pejFimPMD9Q="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:24OomS4NeEMlWyU7cYPzqTI5B9s=
Content-Language: en-GB
In-Reply-To:
Bytes: 2183
On 28/10/2024 11:58, Thiago Adams wrote:
>
> 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.
If that is what you want, then why not simply say:
const unsigned char ch = 210;
Or change it to the char to a short (or int, long, etc).
?
It's a good and helpful warning. I cannot see why you'd want to ignore it.
Do you expect to remember that 1234 really equals 210 in five years time?