Earlier quoted context omitted.
The problem is that after calling scanf(), the number of variables that are defined is a variable number. For example: int x, y, z; int n = scanf("%d %d %d", &x, &y, &z); At compile time, you can make no inferences about which of x, y, and z are defined, because that depends on the returned value n. There are many ways to branch out from this. One is to insist on definite assignment - so if we cannot prove all of the…
I interpret "don't allow unintialized locals when declared" as meaning that this call: int n = scanf("%d %d %d", &x, &y, &z); Would be caught, because it takes references to undeclared variables. To be allowed, the programmer would have to initialize the variables beforehand.
How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
231–240 of 315 posts
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#232Earlier quoted context omitted.
Nope. You have to remember https://www.hyrumslaw.com/ With a sufficient number of users of an API, it does not matter what you promise in the contract: all observable behaviors of your system will be depended on by somebody. If you promise randomization, then somebody will depend on that :) And then you can never remove it!
> If you promise randomization You don't. You say the order is undefined.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#233Earlier quoted context omitted.
Any sane language would design a list iterator to follow the order of the list. No, the difference is when you're iterating over orderless hash-based sets or maps/dictionaries. Many languages choose to leave the iteration order undefined. I think Python did that up to a point, but afterward they defined dictionaries (but not sets) to be iterated over in the order that keys were added. Also, some languages intentional…
Best change ever, that. Now it would also be nice if sets were ordered too.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#234Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#235I always enjoy reading deeply technical writeups like these. I only wonder how much more rare they may or may not get in the AI era.
I don't think they will get more rare; there will always be a top % of engineers that do deep dives. I hope anyway. But AI won't replace them, nor did the past 50+ years of software development innovation. There's millions (tens of millions?) of higher programming language developers that don't know the difference between stack or heap besides maybe some theory they half remember from school but they don't care becau…
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#236I always enjoy reading deeply technical writeups like these. I only wonder how much more rare they may or may not get in the AI era.
i think the shift will be from craftmens to trademens in regards to general software engineers, but these are type of writes up stem of a artisan style all to its own.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#237Earlier quoted context omitted.
i think the shift will be from craftmens to trademens in regards to general software engineers, but these are type of writes up stem of a artisan style all to its own.
We have been seeing this shift for a while, where "software engineers" graduate from 3 month bootcamps. Except now most likely they will not be earning 500k making crud apps.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#238IMHO, if something isn’t part of the contract, it should be randomized. Eg if iteration order of maps isn’t guaranteed in your language, then your language should go out of its way to randomize it. Otherwise, you end up with brittle code: code that works fine until it doesn’t.
Then you are wasting runtime clock cycles randomizing lists.
Re: How a 20 year old bug in GTA San Andreas surfaced in Windows 11 24H2
#239> all these findings prove that the bug is NOT an issue with Windows 11 24H2, as things like the way the stack is used by internal WinAPI functions are not contractual and they may change at any time, with no prior notice. The real issue here is the game relying on undefined behavior (uninitialized local variables), and to be honest, I’m shocked that the game didn’t hit this bug on so many OS versions, although as I…
Other than C#, there is no reason to use those other languages for game dev. Unless the game is fairly simple, or you want to risk a fairly long project by employing a language that hasn't been proven in tge space yet (Rust). No shade at any of those languages, I don't even like C#, just being pragmatic.