phongn commented on code in PR #10782:
URL: https://github.com/apache/trafficserver/pull/10782#discussion_r1396084724


##########
include/tscore/ink_platform.h:
##########
@@ -122,7 +122,7 @@ struct ifafilt;
 #ifdef HAVE_VALUES_H
 #include <values.h>
 #endif
-#ifdef HAVE_ALLOCA_H
+#if __has_include(<alloca.h>)

Review Comment:
   I've been reading up on man pages on recent Linux, FreeBSD and macOS: 
   
   Linux: 
   
   
   > Normally, `gcc(1)` translates calls to `alloca()` with inlined code.  This 
is not done when either the `-ansi`, `-std=c89`, `-std=c99`, or the `-std=c11` 
option is given and the header `<alloca.h>` is not included.  Otherwise, 
(without an `-ansi` or `-std=c*` option) the glibc version  of  `<stdlib.h>` 
includes `<alloca.h>` and that contains the lines:
   > 
   > `#ifdef  __GNUC__`
   > `#define alloca(size)   __builtin_alloca (size)`
   > `#endif`
   >
   > with messy consequences if one has a private version of this function.
   >
   > The fact that the code is inlined means that it is impossible to take the 
address of this function, or to change its behavior by linking with a different 
library.
   >
   > The inlined code often consists of a single instruction adjusting the 
stack pointer, and does not check for stack overflow. Thus, there is no NULL 
error return.
   
   FreeBSD: 
   
   > `#include  <stdlib.h>`
   
   macOS: 
   
   > `#include <alloca.h>` or
   > `#include <stdlib.h>`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to