Deutsch English Français Italiano |
<vfj5up$3q2lf$1@dont-email.me> 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: James Kuyper <jameskuyper@alumni.caltech.edu> Newsgroups: comp.lang.c Subject: Re: constexpr keyword is unnecessary Date: Sat, 26 Oct 2024 11:08:09 -0400 Organization: A noiseless patient Spider Lines: 20 Message-ID: <vfj5up$3q2lf$1@dont-email.me> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Date: Sat, 26 Oct 2024 18:38:50 +0200 (CEST) Injection-Info: dont-email.me; posting-host="30768f9ac8b6ba6e04f9e75171848d18"; logging-data="4000431"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191LHUL+eP48uBXhOFEiAG0Zx02bb1V+7I=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:qVTi9XTDiA843Ge8EWHyGo3f8xQ= In-Reply-To: <vfit29$3obkb$1@dont-email.me> Content-Language: en-US Bytes: 2500 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. While that's a deliberately silly example, I've seen a fair number of warnings that had little or no justification. The purpose of warnings is to tell you that there might be a problem. If the compiler is certain that there's a problem, it should generate an error message, not a warning. Therefore, treating warnings as if they were error messages means that you're not doing your job, as the developer, to determine whether or not the code is actually problematic.