Re: another C-like language? was Compilers :)

"marb...@yahoo.co.uk" <marblypup@yahoo.co.uk>
Sun, 15 Jan 2023 04:26:48 -0800 (PST)

          From comp.compilers

Related articles
[18 earlier articles]
Re: another C-like language? was Compilers :) findlaybill@blueyonder.co.uk (Bill Findlay) (2023-01-11)
Re: another C-like language? was Compilers :) david.brown@hesbynett.no (David Brown) (2023-01-11)
Re: another C-like language? was Compilers :) laguest@archeia.com (Luke A. Guest) (2023-01-13)
Re: another C-like language? was Compilers :) gneuner2@comcast.net (George Neuner) (2023-01-13)
Re: another C-like language? was Compilers :) 864-117-4973@kylheku.com (Kaz Kylheku) (2023-01-14)
Re: another C-like language? was Compilers :) marblypup@yahoo.co.uk (marb...@yahoo.co.uk) (2023-01-15)
Re: another C-like language? was Compilers :) marblypup@yahoo.co.uk (marb...@yahoo.co.uk) (2023-01-15)
Re: another C-like language? was Compilers :) anw@cuboid.co.uk (Andy Walker) (2023-01-15)
| List of all articles for this month |

From: "marb...@yahoo.co.uk" <marblypup@yahoo.co.uk>
Newsgroups: comp.compilers
Date: Sun, 15 Jan 2023 04:26:48 -0800 (PST)
Organization: Compilers Central
References: 23-01-001 23-01-002 23-01-003 23-01-008 23-01-016 23-01-029 23-01-033 23-01-034 23-01-040
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="39257"; mail-complaints-to="abuse@iecc.com"
Keywords: C, optimize
Posted-Date: 15 Jan 2023 13:11:12 EST
In-Reply-To: 23-01-040

On Wednesday, 11 January 2023 at 23:10:38 UTC, David Brown wrote:
> The same applies to C and C++ programming, when using static error
> checking. (And during development, you should definitely be using a
> compiler capable of spotting missing initialisations, and you should
> treat such warnings as bugs in your code.) And like Java tools, C and
> C++ compilers are not /quite/ perfect :-)
>
> So I agree that there are occasional uses for such "artificial"
> initialisation. There are also occasions when declaring a variable
> without initialising makes sense because you will later set its value
> inside a conditional.


Indeed. I've occasionally had compilers complain about uninitialised
variables though I could see that my (rather perverse?) code did
always initialise them before they were used (but possibly not if they
weren't). In such cases, I've added an initialisation to the
declaration just to shut the compiler up. (Warnings of uninitialised
variables usually do indicate bugs.)



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.