BUG? Stack size for char variables

Soslan Khubetsov Soslan.Khubetsov@inci.ru
Mon Jan 22 08:00:00 GMT 2001


test.c
---------------
#include <stdio.h>
main(int argc, char **argv)
{
    char test[3];
}
---------------


ASSEMBLER CODE
---------------
        .file   "test.c"
        .version        "01.01"
gcc2_compiled.:
.text
        .align 4
.globl main
        .type    main,@function
main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $24, %esp             <----------- WHY 24 (3?)
        leave
        ret
.Lfe1:
        .size    main,.Lfe1-main
        .ident  "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.0)"
---------------


it work right only for char[8]




More information about the Gcc-bugs mailing list