From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10246 invoked by alias); 24 Apr 2002 11:49:39 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10224 invoked from network); 24 Apr 2002 11:49:33 -0000 Received: from unknown (HELO mail.redhat.de) (193.103.254.4) by sources.redhat.com with SMTP; 24 Apr 2002 11:49:33 -0000 Message-ID: <3CC69BC8.9020101@redhat.com> Date: Wed, 24 Apr 2002 05:22:00 -0000 From: Manfred Hollstein X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Scholz Maik (CM-CR/EES3) *" Cc: "'gcc@gcc.gnu.org'" Subject: Re: howto use -fstack-check References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg01233.txt.bz2 Scholz Maik (CM-CR/EES3) * wrote: > We have an embedded system with a > RTOS without any stack check. > > How can I use the gcc build in stack check > "-fstack-check" From gcc's info page: `-fstack-check' Generate code to verify that you do not go beyond the boundary of the stack. You should specify this flag if you are running in an environment with multiple threads, but only rarely need to specify it in a single-threaded environment since stack overflow is automatically detected on nearly all systems if there is only one stack. Note that this switch does not actually cause checking to be done; the operating system must do that. The switch causes generation of code to ensure that the operating system sees the stack being extended. This means to me, you try with "-S -fstack-check" when compiling your code and see how the generated code looks like. > > Regards > > Maik Scholz > HTH. Cheers. l8er manfred -- Manfred Hollstein Red Hat GmbH GPG fingerprint: 1D1F 0F5A 32C1 9E2A B8BA 561A E372 AF4C 0581 D831