#24 alloca macro



  • Takeshi SONE

    Takeshi SONE - 2000-12-15


  • Danny Smith

    Danny Smith - 2000-12-16

    Do these macros really belong in system headers? The builtin alloca may be what we want most of the time. But what if we really want to use our own alloca() (or the one in libiberty.a?). Right, we put in another guard:
    #if defined (__GNUC__) && ! defined (USE_C_ALLOCA)

    IMHO, best leave these redefinitions of alloca to specific projects. Configure scripts have been doing this for a long time. (look no further than the mingw-runtime configure).


  • Takeshi SONE

    Takeshi SONE - 2000-12-16

    Yes, both GNU-based systems and MSVC work like this way.
    In fact, mingw itself has been working this way, because alloca is builtin by default.

    Anytime when you don't want those non-ANSI stuff, you can use '-ansi' to gcc.

    I don't believe people really want to use C implementation of alloca.
    (it's not a true alloca, and mingw-built libiberty.a does NOT have alloca, because mingw has working alloca in gcc)

    configure scripts have been just leaving a line '#define HAVE_ALLOCA 1' for me.

  • Earnie Boyd

    Earnie Boyd - 2001-01-30
    • assigned_to: nobody --> earnie
    • status: open-postponed --> closed-postponed
  • Earnie Boyd

    Earnie Boyd - 2001-01-30

    I have postponed this patch to allow Mumit more time to review it and fix bugs in libgcc.a wrt alloca.