This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/38274] New: why the option "-fstack-protector-all" doesn't works?
- From: "zuogang at huawei dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Nov 2008 09:24:59 -0000
- Subject: [Bug c/38274] New: why the option "-fstack-protector-all" doesn't works?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
source file:
#include <stdio.h>
int main(void)
{
char a = 1;
int b = 2;
short c = 3;
char sztmp[22] = "hello worlds!";
*(int *)&a=0xffff;
sztmp[22]=0;
printf("%s,a:%d,b%d\n",sztmp,a,b);
return 0;
}
invoke gcc by :gcc -fstack-protector-all test.c;
after my debugging a.out, I find the gcc doesn't adding a guard variable to
functions's local stack vars, and the var "sztmp" follows var "a" and there
aren't any room between the two vars.
--
Summary: why the option "-fstack-protector-all" doesn't works?
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: zuogang at huawei dot com
GCC host triplet: x86, SUSE 10 ES,
GCC target triplet: X86
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38274