Don't blindly provide alloca() for all compilers -- it is too implementation
dependent. Instead provide one for GCC & Intel's GCC copy and one for lint. Anyone using any other translator tool needs to look closely at how that tool can handle alloca.
This commit is contained in:
parent
1300bbb70e
commit
d7875fc3b3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116831
@ -222,7 +222,6 @@ extern const char *_malloc_options;
|
|||||||
extern void (*_malloc_message)(const char *, const char *, const char *,
|
extern void (*_malloc_message)(const char *, const char *, const char *,
|
||||||
const char *);
|
const char *);
|
||||||
|
|
||||||
#ifndef alloca
|
|
||||||
/*
|
/*
|
||||||
* The alloca() function can't be implemented in C, and on some
|
* The alloca() function can't be implemented in C, and on some
|
||||||
* platforms it can't be implemented at all as a callable function.
|
* platforms it can't be implemented at all as a callable function.
|
||||||
@ -232,11 +231,13 @@ extern void (*_malloc_message)(const char *, const char *, const char *,
|
|||||||
* programs which use it will fail to link when compiled with non-GNU
|
* programs which use it will fail to link when compiled with non-GNU
|
||||||
* compilers.
|
* compilers.
|
||||||
*/
|
*/
|
||||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
#if __GNUC__ >= 2 || defined(__INTEL_COMPILER)
|
||||||
|
#undef alloca /* some GNU bits try to get cute and define this on their own */
|
||||||
#define alloca(sz) __builtin_alloca(sz)
|
#define alloca(sz) __builtin_alloca(sz)
|
||||||
#else
|
#elif defined(lint)
|
||||||
void *alloca(size_t);
|
void *alloca(size_t);
|
||||||
#endif
|
#error Please add alloca support on all FreeBSD architectures for this compiler.
|
||||||
|
#else
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__uint32_t
|
__uint32_t
|
||||||
|
Loading…
Reference in New Issue
Block a user