This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Memory Allocation On Stack
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: "Pankaj Kohli" <pankaj208 at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 20 Jul 2007 11:29:31 +0100
- Subject: Re: Memory Allocation On Stack
- References: <4ae360740707200111gc2af7e5pdf98871135f5fff5@mail.gmail.com>
Pankaj Kohli writes:
> I wrote a simple C program to test the memory allocation for local
> variables. But when i try to disassemble the program using gdb, it
> shows that 16 bytes are being reserved for local variables on the
> stack, although i declared a single integer variable which is supposed
> to take only 4 bytes.
> Can anyone tell, why it is reserving 16 bytes on the stack for just a
> single variable ?
This question was asked on the kernel list on May 19, 2007. Please
find the answer at http://kerneltrap.org/node/8236
Andrew.