public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@cygnus.com>
To: Nick Duffek <nsd@redhat.com>
Cc: meissner@cygnus.com, gdb@sources.redhat.com
Subject: Re: alloca is bad?
Date: Tue, 14 Nov 2000 06:37:00 -0000	[thread overview]
Message-ID: <20001114093702.32186@cse.cygnus.com> (raw)
In-Reply-To: <200011132129.eADLTfJ17017@rtl.cygnus.com>

On Mon, Nov 13, 2000 at 04:29:41PM -0500, Nick Duffek wrote:
> On 13-Nov-2000, Michael Meissner wrote:
> 
> >That won't work, since alloca is a builtin provided by GCC.
> 
> That can be disabled by compiling with -fno-builtin.

It isn't as simple as that with GNU software, which generally has code like the
following in an include file:

	#if defined(__GNUC__) && !defined(C_ALLOCA)
	# ifndef alloca
	#  define alloca __builtin_alloca
	# endif
	#else /* ! defined (__GNUC__) */

(ie, if the compiler is GCC always use the builtin function).  You probably
also need to rebuild the whole app, and not just relink it.

> >If GCC is detected as the compiler at configuration time, then alloca is
> >not even built into libiberty.
> 
> True, but that's easy to circumvent.
> 
> Using -lefence or other debugging mallocs to debug alloca overruns isn't
> as easy as a simple relink, but it doesn't seem fundamentally difficult.
> 
> Nick

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

  reply	other threads:[~2000-11-14  6:37 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-09 18:20 Christopher Faylor
2000-11-09 18:37 ` Michael Meissner
2000-11-09 19:22   ` Christopher Faylor
2000-11-09 20:57     ` Nick Duffek
2000-11-09 22:18       ` Andrew Cagney
2000-11-09 22:20         ` Christopher G. Faylor
2000-11-10  6:21           ` Jim Blandy
2000-11-10  8:27             ` Christopher Faylor
2000-11-10 22:13             ` Andrew Cagney
2000-11-10 23:34               ` Eli Zaretskii
2000-11-11  9:08               ` Nick Duffek
2000-11-11 11:37                 ` Fernando Nasser
2000-11-11 13:16                   ` Nick Duffek
2000-11-12 16:42               ` Michael Meissner
2000-11-12 22:49               ` [RFA] alloca coding standard Nick Duffek
2000-11-13  3:16                 ` Eli Zaretskii
2000-11-13  4:51                 ` Andrew Cagney
2000-11-13  8:45                   ` [RFA] Move alloca(0) to wait_for_inferior() from registers_changed() Nick Duffek
2000-11-13  9:32                     ` Nick Duffek
2000-11-13  7:13                 ` [RFA] alloca coding standard Fernando Nasser
2000-11-13 12:31                 ` Nick Duffek
     [not found]                   ` <nsd@redhat.com>
2000-11-13 12:58                     ` Kevin Buettner
2000-11-13 13:19                       ` Nick Duffek
2000-11-14  7:42                         ` Jim Blandy
2000-11-14  7:54                           ` Michael Meissner
2000-11-14 10:27                             ` Jim Blandy
2000-11-14 17:15                               ` Andrew Cagney
2000-11-15  3:21                         ` Eli Zaretskii
2000-11-15 12:41                           ` Christopher Faylor
2000-11-15  3:20                   ` Eli Zaretskii
2000-11-10  2:40     ` alloca is bad? Eli Zaretskii
2000-11-11 11:52     ` Fernando Nasser
2000-11-11 16:13       ` Christopher Faylor
2000-11-12  0:20         ` Fernando Nasser
2000-11-11 21:39       ` Eli Zaretskii
2000-11-12  0:07         ` Fernando Nasser
2000-11-12  4:17           ` Eli Zaretskii
2000-11-12 10:39             ` Chris Faylor
2000-11-12 15:16               ` Andrew Cagney
2000-11-12 15:16             ` Fernando Nasser
2000-11-13  3:13               ` Eli Zaretskii
2000-11-13  8:05                 ` Michael Meissner
2000-11-12 16:49             ` Michael Meissner
2000-11-12  1:55         ` Andrew Cagney
2000-11-12 17:00           ` Michael Meissner
2000-11-13  3:14             ` Eli Zaretskii
2000-11-13  8:10               ` Michael Meissner
2000-11-13 12:14             ` Nick Duffek
2000-11-13 12:21               ` Michael Meissner
2000-11-13 13:24                 ` Nick Duffek
2000-11-14  6:37                   ` Michael Meissner [this message]
2000-11-14  7:39               ` Jim Blandy
2000-11-09 22:27 ` Andrew Cagney
2000-11-10  2:39 ` Eli Zaretskii
2000-11-10  8:16   ` Chris Faylor
2000-11-10  8:42     ` Fernando Nasser
2000-11-10  8:46       ` Christopher Faylor
2000-11-10  9:08         ` Fernando Nasser
2000-11-10 22:17           ` Andrew Cagney
2000-11-10  9:05       ` Michael Meissner
2000-11-10 12:00     ` Eli Zaretskii
2000-11-10 21:34     ` Andrew Cagney
2000-11-11 10:07       ` Christopher G. Faylor
2000-11-13  7:52         ` Jim Blandy
2000-11-13  8:25           ` Christopher G. Faylor
  -- strict thread matches above, loose matches on Subject: below --
2000-10-31 19:17 Subscribe gdb-prs@sources.redhat.com to gdb@sources.redhat.com? Christopher Faylor
2000-10-31 21:28 ` Andrew Cagney
2000-10-31 21:34   ` Christopher Faylor
2000-11-01  9:15     ` Tom Tromey
2000-11-01 10:54       ` Christopher Faylor
2000-10-26 20:10 GDB GNATS bug tracking database available Christopher Faylor
2000-10-28  4:41 ` Andrew Cagney
     [not found] ` <cgf@redhat.com>
2000-10-26 21:18   ` Kevin Buettner
2000-10-27  7:39     ` Fernando Nasser
2000-10-27  9:35     ` Christopher Faylor
2000-10-31 22:07   ` Subscribe gdb-prs@sources.redhat.com to gdb@sources.redhat.com? Kevin Buettner
2000-11-12 11:30   ` alloca is bad? Kevin Buettner
2000-11-12 15:32     ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20001114093702.32186@cse.cygnus.com \
    --to=meissner@cygnus.com \
    --cc=gdb@sources.redhat.com \
    --cc=nsd@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).