On Tue, 4 Nov 2025 10:33:33 +0100 "Eric Rullens" <[email protected]> wrote:
> Hi Basil, > > Yes, I have seen this as well. After compiling I always calculate a CRC over > the entire binary, and this is not identical over compile cycles. > > It has been some time since I investigated this, but Windows 10 (and 11) > contain some memory protection features that are not present in Windows 7: > > https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/overview-of-threat-mitigations-in-windows-10#table-2 > > These should not influence "correct" programs, but I suspect SDCC somewhere > uses uninitialized memory and/or pointers. > That statement is actually incorrect. A perfectly correct C program can compare pointers and behave differently depending whether an object is allocated before or after another one. Memory randomisation and similar effects can in turn change those orderings. The classic example is lock ordering by memory address. So whilst it might be an uninitialized value, or even deliberate randomization there are a number of completely valid reasons around stuff like tie breakers on sorting and so on that will also result in behaviour varying. Creating a program that behaves the same way under memory randomization actually requires you follow some rigorous rules. Alan _______________________________________________ Sdcc-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sdcc-user
