tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Adding <alloca.h> ?

I think there's several points of view:

1) Everything using alloca() is broken (valid, it's a nasty function)

2) Everything using extensions should properly declare it does so
   (using eg. -std=gnu99 and so on), and not use standards mode. 

2) Software that makes certain assumptions about almost-universal
   functions should compile cleanly on NetBSD without patching.

In my mind, including <alloca.h> is a clear demonstration of _intent_,
so should be equivalent to specifying e.g. -std=gnu99, i.e. it should
be enough to get alloca to work properly.

We could even add an automatic compiler warning that alloca is unsafe
to the header, if we went that route.

The current situation in pkgsrc (where lots of software using alloca
needs to be BUILDLINK_TRANSFORMED to use the -std=gnu... variant, or
is patched to use the builtin directly) is not really one I'm happy

Home | Main Index | Thread Index | Old Index