<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">clang is pretty strict by default and I generally try to fix any warnings it finds, as opposed to overriding them. If you think the requested changes aren’t needed, I’ll go that route. My thought was to lessen the angst for beginners compiling libpd & being put off by a wall of warnings (especially in ofxPd).<div class=""><br class=""></div><div class="">I realized I can fix the alloc warning by adding HAVE_ALLOCA_H to the libpd Makefile, so the stdlib.h include is unnecessary. Furthermore, Maybe this define would be unnecessary by using better compile-time system detection. For example, from d_fft_fftsg.c:</div><div class=""><br class=""></div><div class="">#ifdef HAVE_ALLOCA_H        /* ifdef nonsense to find include for alloca() */<br class=""># include <alloca.h>        /* linux, mac, mingw, cygwin */<br class="">#elif defined _MSC_VER<br class=""># include <malloc.h>        /* MSVC */<br class="">#else<br class=""># include <stddef.h>        /* BSDs for example */<br class="">#endif                      /* end alloca() ifdef nonsense */</div><div class=""><br class=""></div><div class="">Could be:</div><div class=""><br class=""></div><div class="">#ifdef _MSC_VER</div><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>#include <malloc.h> /* MSVC */</div><div class="">#elif defined(__linux__) || defined(__APPLE__) || defined(_WIN32)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>#include <alloca.h> /* linux, mac, mingw, cygwin */</div><div class="">#else</div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>#include <stddef.h> /* BSDs for example */</div><div class="">#endif</div><div class=""><br class=""></div><div class="">I just tried and it compiles said file without the warning on OSX.</div><div class=""><br class=""></div><div class="">References:</div><div class="">* <a href="http://stackoverflow.com/questions/5919996/how-to-detect-reliably-mac-os-x-ios-linux-windows-in-c-preprocessor" class="">http://stackoverflow.com/questions/5919996/how-to-detect-reliably-mac-os-x-ios-linux-windows-in-c-preprocessor</a></div><div class="">* <a href="https://sourceforge.net/p/predef/wiki/OperatingSystems/" class="">https://sourceforge.net/p/predef/wiki/OperatingSystems/</a></div><div class=""><br class=""><div class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">--------<br class="">Dan Wilcox<br class=""><a href="https://twitter.com/danomatika" class="">@danomatika</a><br class=""><a href="http://danomatika.com" class="">danomatika.com</a><br class=""><div class=""><a href="http://robotcowboy.com" class="">robotcowboy.com</a></div></div>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Mar 24, 2016, at 10:03 PM, Miller Puckette <<a href="mailto:msp@ucsd.edu" class="">msp@ucsd.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Sorry, missed this last...  if it's needed I'd prefer to add stdlib.h to all<br class="">the files where alloca gets used (so as not to include any more than necessary<br class="">in m_pd.h).<br class=""><br class="">cheers<br class="">M<br class=""><br class=""><br class="">On Thu, Mar 24, 2016 at 09:37:33PM -0600, Dan Wilcox wrote:<br class=""><blockquote type="cite" class="">Whoops. Missed a couple spots. Also, forgot to mention I added #include <stdlib.h> to m_pd.h to silence "warning: implicitly declaring library function 'alloca' with type 'void *(unsigned long)’” in x_array, x_list, etc.<br class=""><br class="">Here’s a new patch. Disregard the first one.<br class=""><br class=""><br class=""></blockquote></div></div></blockquote></div><br class=""></div></div></body></html>