| Deutsch English Français Italiano |
|
<86ses5smv8.fsf@linuxsc.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch <tr.17687@z991.linuxsc.com> Newsgroups: comp.lang.c Subject: Re: constexpr keyword is unnecessary Date: Tue, 05 Nov 2024 07:48:11 -0800 Organization: A noiseless patient Spider Lines: 23 Message-ID: <86ses5smv8.fsf@linuxsc.com> References: <veb5fi$3ll7j$1@dont-email.me> <877ca5q84u.fsf@nosuchdomain.example.com> <vf0ijd$3u54q$1@dont-email.me> <vf0l98$3un4n$1@dont-email.me> <vf1216$p0c$1@dont-email.me> <87y12jpxvl.fsf@nosuchdomain.example.com> <vf1d2o$2hjk$1@dont-email.me> <87plnvpgb9.fsf@nosuchdomain.example.com> <vf2sm8$deou$1@dont-email.me> <vf7m4s$1d8mj$1@raubtier-asyl.eternal-september.org> <vf86uc$1fvt3$1@dont-email.me> <vfit29$3obkb$1@dont-email.me> <vfj5up$3q2lf$1@dont-email.me> <20241027220459.109@kylheku.com> <vfnu92$vp1g$1@dont-email.me> <20241028215919.996@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Tue, 05 Nov 2024 16:48:12 +0100 (CET) Injection-Info: dont-email.me; posting-host="22162f0ba694a79b67a6bd5db328b824"; logging-data="1682490"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QYGUvzdb3j/TPPdX6/J02o+W2K6nlDsI=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:+Zyj417C50+1Jkn8IKpAdf8zC/k= sha1:cPzzmh0wv1ABBzBiNFWh4AtU3nI= Bytes: 2152 Kaz Kylheku <643-408-1753@kylheku.com> writes: > On 2024-10-28, Thiago Adams <thiago.adams@gmail.com> wrote: > >> 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. > > For conversion warnings, that portable way should ideally be a cast. A commonly held view, but a bad idea nonetheless.