Re: Possible OS incompatibility with __attribute__ 'shared'
<[email protected]> Tue, 23 Dec 2025 11:20:16 -0000
| Newsgroups | gmane.comp.gcc.help |
|---|---|
| Message-ID | <[email protected]> |
Thanks again to all who answered me. I'm posting the result in case there are people who like it when someone does that. (I do..)
When using this:
int foo __attribute__((section ("shared"), shared)) = 0;
GCC is fine, with W98 and Windows 7.
It turned out it was no the setting of the variable, but subsequent REsetting, that caused unrest. As it was always to be reset, I did that synchronously right after the event that needed the flag set, and it works flawlessly in all tests in all places I tried it.
For the record, I did a quick test with a window's UserData and GetWindowsLong to replace the shared global. (Because I've used that before to useful effect, and it's easy and fast to write.) The resulting flaw was identical despite the dramatically different method of sharing a 32-bit value, proving that the intermittency had a totally unrelated cause. Knowing that, I found it and fixed it...
Crow