| Deutsch English Français Italiano |
|
<86zfhhpl5n.fsf@linuxsc.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch <tr.17687@z991.linuxsc.com> Newsgroups: comp.lang.c Subject: Re: int a = a (Was: Bart's Language) Date: Tue, 18 Mar 2025 23:52:20 -0700 Organization: A noiseless patient Spider Lines: 30 Message-ID: <86zfhhpl5n.fsf@linuxsc.com> References: <vracit$178ka$1@dont-email.me> <vrc2d5$1jjrf$1@paganini.bofh.team> <vrc4eb$2p28t$1@dont-email.me> <vrc75b$2r4lt$1@dont-email.me> <vrccjb$b3m6$1@news.xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Wed, 19 Mar 2025 07:52:23 +0100 (CET) Injection-Info: dont-email.me; posting-host="f38801bdea7b04066d3e2a5989bc7bcf"; logging-data="294776"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ird42QnXx91GWCTYejFpkOENAqlOJyds=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:oPHcWMZiE/zAMNkBBEtRmGxqdDg= sha1:FgwBRvGtLFDcozxX8r43zDY46Ow= Bytes: 2353 gazelle@shell.xmission.com (Kenny McCormack) writes: > In article <vrc75b$2r4lt$1@dont-email.me>, > David Brown <david.brown@hesbynett.no> wrote: > ... > >>> gcc won't warn until you say '-Wextra', and then only for: >>> >>> int a = a + 1; >> >> People would not normally write "int a = a;". It is used as a >> common idiom meaning "I know it is not clear to the compiler that >> the variable is always initialised before use, but /I/ know it is - >> so disable the use-without-initialisation warnings for this >> variable". So it makes perfect sense for the compiler not to warn >> about it! An addle-brained view. Anyone who thinks that should be forcibly removed from any activity involving software development. > Wouldn't it just be easier and clearer to write: int a = 0; > and be done with it? There are two problems: one, the semantics are different; and two, the impression given of the author's intent is different. It's kind of like saying "isn't it just easier and clearer to write 'red' rather than 'yellow'?" Writing 'int a = 0;' might be better or it might be worse, depending on one's point of view, but it shouldn't be considered either more clear or less clear, because it isn't saying the same thing.