This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Preserving order of variable declarations
- From: Diego Novillo <dnovillo at google dot com>
- To: Aravinda <aravindakidambi at gmail dot com>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Wed, 23 Dec 2009 09:57:17 -0500
- Subject: Re: Preserving order of variable declarations
- References: <26eb53620912220847x3c104816me56d87580d6478c3@mail.gmail.com>
On Tue, Dec 22, 2009 at 11:47, Aravinda <aravindakidambi@gmail.com> wrote:
> Is this is the only way it can be done ? Or can I have
> (non-temporary)variables inserted whos order can be preserved always ?
Not really, the compiler will reorder variables in the stack in almost
arbitrary ways. Wrapping them in structs is the safest approach.
Diego.