Deutsch English Français Italiano |
<v4lfuq$3rh94$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: BGB <cr88192@gmail.com> Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Sat, 15 Jun 2024 20:42:47 -0500 Organization: A noiseless patient Spider Lines: 56 Message-ID: <v4lfuq$3rh94$1@dont-email.me> References: <v2l828$18v7f$1@dont-email.me> <v38of2$1gsj2$1@dont-email.me> <v39v87$1n7bk$1@dont-email.me> <20240530170836.00005fa0@yahoo.com> <v3a3k5$1ntrn$1@dont-email.me> <20240530180345.00003d9f@yahoo.com> <v3chc4$27uij$1@dont-email.me> <20240531161937.000063af@yahoo.com> <20240531162811.00006719@yahoo.com> <20240531164835.00007128@yahoo.com> <v3cldt$28n91$2@dont-email.me> <20240531173437.00003bee@yahoo.com> <v3d3ct$2b5sl$1@dont-email.me> <v3d97c$2c6ea$1@dont-email.me> <22r6O.5934$xPJ1.2590@fx09.iad> <v3t6nu$1liet$1@dont-email.me> <v3tlmo$1o860$7@dont-email.me> <v3vvph$27spv$1@dont-email.me> <v40hum$2err2$1@dont-email.me> <v40oqa$2fjig$1@dont-email.me> <v4enr5$28m3j$1@raubtier-asyl.eternal-september.org> <v4fg41$2dh69$1@dont-email.me> <v4gpdb$2pbb6$1@raubtier-asyl.eternal-september.org> <v4gu5q$2q8qp$1@dont-email.me> <v4l5d5$3lqic$8@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 16 Jun 2024 03:42:51 +0200 (CEST) Injection-Info: dont-email.me; posting-host="1ad0e9f7ffa131f3e89097e47f00f66b"; logging-data="4048164"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dNwU8AvCc/UkKHXVoQUahF0P47wfqzjg=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:a6JaM6Vmb/V6TIo8aJlPuCR6b1E= Content-Language: en-US In-Reply-To: <v4l5d5$3lqic$8@dont-email.me> Bytes: 4189 On 6/15/2024 5:42 PM, Lawrence D'Oliveiro wrote: > On Fri, 14 Jun 2024 03:13:32 -0500, BGB wrote: > >> On 6/14/2024 1:53 AM, Bonita Montero wrote: >>> >>> Am 13.06.2024 um 21:07 schrieb BGB: >>>> >>>> One possible justification (albeit a weak one) is that if one >>>> recompiles the program with optimizations turned on, in many cases >>>> this may subtly change the behavior of the program (particularly in >>>> relation to things like the contents of uninitialized variables and >>>> dangling pointers, etc...). ... >>> >>> If you rely on that you're misusing the language anyway. >>> >> It is a poor practice, but seemingly does occur in the wild (intentional >> or not). > > It seems to me that kind of thing does tend to get flushed out of open- > source code. Because such code is often compiled with different compilers, > on different architectures, using different tool chains etc. And > assumptions like these tend not to survive such treatment. Yeah, true enough. Given that these are the sort of things that tend to break whenever the compiler/architecture/optimization settings/etc is changed, then it makes sense that they will get weeded out. As noted, a lot of the sorts of bugs I had found in this category, was when trying to port various MS-DOS era code to my project. Though, not too long ago, ran into a similar sort of bug, where the code had "just so happened" to be working because a stack-based array happened to be in the same spot between two functions and just so happened (in the latter call) to contain the data needed from the former function (in this case, perturbing this coincidence would cause the PE/COFF loader to fail to locate binaries; trying to access "some random garbage" rather than the path to the EXE). 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). Though, I suspect it may had actually have broken in the past (when poking around at the code generation in BGBCC), but at the time I had thought it was due to "some unknown compiler bug" (and didn't look around enough to realize that it was instead an "uninitialized array contents" bug in the code being compiled). ....