[gnu.gcc.bug] Ansi functions, built in functions.

ian@sibyl.eleceng.ua.oz.au (01/15/90)

Since the mem{set,cpy,mv,cmp} etc functions are ansi standards isn't
it about time we started using them in preference to b{copy,zero} etc?

On a different tack, the gcc documentation seems very sparce on
builtin functions. I found out from an oblique reference to alloca
being built in. I then grepped through everything until I found out
what to define to what and now I use I use __builtin_alloca for all
the GNU stuff that needs alloca. As a consequence (of all that
grepping) I also discovered that there is a whole swag of other
__builtin_... functions, none of which are defined in the
documentation.

How about raising the profile of __builtin_... functions in the
documentation? Also __builtin_alloca doesn't necessarilly work for all
implimentations (as distributed, the ns32k based ports do not
impliment __builtin_alloca properly at least), so code which does

#ifdef __GNUC__
#define alloca __builtin_alloca
#endif

isn't always right. Are there other builtin functions which mightn't
always work? It might seem that a GCC builtin.h include file could be
warranted so that you can do

#ifdef __GNUC__
#include <builtins.h>
#endif

Then if a particular implimentation can't impliment a particular
builtin function, it is left undefined in the include file and the
conventional library function will be used.