From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16898 invoked by alias); 26 Nov 2008 09:26:26 -0000 Received: (qmail 9381 invoked by uid 48); 26 Nov 2008 09:24:59 -0000 Date: Wed, 26 Nov 2008 09:26:00 -0000 Subject: [Bug c/38274] New: why the option "-fstack-protector-all" doesn't works? X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "zuogang at huawei dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg02241.txt.bz2 source file: #include 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