* src/makeint.h (free_alloca): New macro to defeat warn_unused_result.
* src/read.c (eval_makefile): Call it.
(eval_buffer): Ditto.
* src/remake.c (update_file): Ditto.
# endif
#endif
+/* Some versions of GCC (e.g., 10.x) set the warn_unused_result attribute on
+ __builtin_alloca. This causes alloca(0) to fail and is not easily worked
+ around so make a helper.
+ See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98055 */
+
+#define free_alloca() do{ void *__p = alloca (0); (void)__p; }while(0)
+
/* Disable assert() unless we're a maintainer.
Some asserts are compute-intensive. */
#ifndef MAKE_MAINTAINER_MODE
fclose (ebuf.fp);
free (ebuf.bufstart);
- alloca (0);
+ free_alloca ();
errno = 0;
return deps;
reading_file = curfile;
- alloca (0);
+ free_alloca ();
}
\f
/* Check LINE to see if it's a variable assignment or undefine.
check_renamed (f);
/* Clean up any alloca() used during the update. */
- alloca (0);
+ free_alloca ();
/* If we got an error, don't bother with double_colon etc. */
if (new && !keep_going_flag)