Path: ...!feed.opticnetworks.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Sun, 16 Jun 2024 03:15:58 -0000 (UTC) Organization: A noiseless patient Spider Lines: 33 Message-ID: References: <20240530170836.00005fa0@yahoo.com> <20240530180345.00003d9f@yahoo.com> <20240531161937.000063af@yahoo.com> <20240531162811.00006719@yahoo.com> <20240531164835.00007128@yahoo.com> <20240531173437.00003bee@yahoo.com> <22r6O.5934$xPJ1.2590@fx09.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 16 Jun 2024 05:15:59 +0200 (CEST) Injection-Info: dont-email.me; posting-host="226f25248701f9e2b898433032a62efe"; logging-data="4071665"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UXi//PYS4FCmb36cj0ZKS" User-Agent: Pan/0.158 (Avdiivka; ) Cancel-Lock: sha1:WmJoOWO9d30piqF6douUzCptO3A= Bytes: 3366 On Sat, 15 Jun 2024 20:42:47 -0500, BGB wrote: > I fairly promptly fixed this bug once discovered, and am then just left > to wonder how exactly it managed to work in the first place (or didn't > break already). Been there, done that. When I set about to revive the then-moribund NCSA Telnet code for Macintosh, back around 1990, it looked like it had been abandoned because nobody had the stomach to do the porting from MPW C v2 (created for Apple by Green Hills) to v3 (developed by Apple itself, thoroughly ANSI- compliant). Besides all the compile-time errors, there were dozens, maybe hundreds, of places to be checked for the different, incompatible definition of the Pascal-equivalent “Str255” type, to ensure there were no lurking bugs. I think I got them all. Then I started up my build, got as far as opening a terminal session, closed it again, quit ... and the app crashed. I discovered that the shutdown loop to ensure all open sessions were closed before quitting had an off-by-1 error in its termination condition: it was accessing an element in the array of open sessions that didn’t exist. Somehow this never manifested a problem with the old C compiler, but it did with the new one. By the way, that MPW C v3 compiler had some quite amusing error messages. Various people (including myself) independently posted lists of them (and once I got accused of plagiarizing the list from someone else--as though someone had made them up). Quite a few people couldn’t believe such messages were real.