Re: allocation alignment for global and local variables.



Eric Sosman wrote:
[... memory order of global variables ...]
> (I once had a lot of trouble porting a large program from
> one machine to the other. On the original machine, file-scope
> variables within a module were allocated to ascending memory
> addresses in the order they were declared -- so foo1 would be
> followed by bar1 in the example above -- and the variables from
> different modules were allocated in the order in which the
> modules were linked. On the target machine I was porting to,
> though, all globals from all modules were pooled together and
> sorted alphabetically by their names. It turned out that the
> program's author relied on the allocate-as-declared order ...)

Too bad you can't say "he got what he deserved", as it was you who ended
up getting it.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>

.