public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38274]  New: why the option "-fstack-protector-all" doesn't works?
@ 2008-11-26  9:26 zuogang at huawei dot com
  2008-11-29  3:11 ` [Bug middle-end/38274] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: zuogang at huawei dot com @ 2008-11-26  9:26 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <bug-38274-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2023-03-21  0:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-26  9:26 [Bug c/38274] New: why the option "-fstack-protector-all" doesn't works? zuogang at huawei dot com
2008-11-29  3:11 ` [Bug middle-end/38274] " pinskia at gcc dot gnu dot org
2008-12-01 10:14 ` zuogang at huawei dot com
2008-12-24  1:48 ` pinskia at gcc dot gnu dot org
2008-12-24  2:55 ` howarth at nitro dot med dot uc dot edu
     [not found] <bug-38274-4@http.gcc.gnu.org/bugzilla/>
2023-03-21  0:03 ` pinskia at gcc dot gnu.org
2023-03-21  0:05 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).