Possible OS incompatibility with __attribute__ 'shared'
<[email protected]> Sun, 21 Dec 2025 21:32:47 -0000
| Newsgroups | gmane.comp.gcc.help |
|---|---|
| Message-ID | <[email protected]> |
Hello. On the web page at https://gcc.gnu.org/onlinedocs/gcc-3.3.3/gcc/Variable-Attributes.html
I found this:
int foo __attribute__((section ("shared"), shared)) = 0;
I got it to work (using MinGW GCC) in W98, but the same method did not work in Windows 7, even when restricted to 32-bit process interactions.
Is this restricted in Windows 7 by design? Is there a way round it? I try to write code (usually successfully) to run equally well on W98 and Windows 7, and I'm looking for the simplest way to share a variable in a hook DLL between processes.
Crow