Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.os.linux.misc    |    Linux-specific topics not covered by oth    |    135,536 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 134,289 of 135,536    |
|    Peter Flass to rbowman    |
|    Re: naughty Python    |
|    02 Jan 26 19:51:17    |
      XPost: alt.folklore.computers       From: Peter@Iron-Spring.com              On 1/2/26 17:52, rbowman wrote:       > On Fri, 2 Jan 2026 15:00:07 -0700, Peter Flass wrote:       >       >> On 1/2/26 14:33, Lawrence D’Oliveiro wrote:       >>> On Fri, 2 Jan 2026 08:49:25 -0800, John Ames wrote:       >>>       >>>> ... it's not guaranteed that the compiler won't take liberties in       >>>> arranging members of a struct for optimization purposes ...       >>>       >>> The C23 spec (section 6.2.5, “Types”) does say the member objects of a       >>> struct type need to be “sequentially allocated”. The only freedom the       >>> compiler has (section 6.2.6) is to add “padding bytes”.       >>       >> It defeats the purpose of a structure if the compiler is free to       >> rearrange it. Local variables (PL/I AUTOMATIC) can, in most languages,       >> be stored however the compiler wants.       >       > That can lead to interesting bugs. The root cause is overflowing a local       > variable, say writing 6 characters to a char[4]. Which adjacent local       > variable gets whacked depends on the compiler's ordering. Whether it       > manifests as a bug depends on how the corrupt variable is used in the       > function and where it is initialized.       >              Indeed. A few times I suspected this I put a character string before and       after where I suspected the problem was, and did lots of checking to       find out where it was being clobbered.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca