From: Akim Demaille Date: Fri, 23 Nov 2001 14:13:19 +0000 (+0000) Subject: * src/system.h: Include alloca.h. X-Git-Tag: BISON-1_30e~14 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/16c4a35041d6f9bd581134f99e3d6e915e48eb8b?ds=inline * src/system.h: Include alloca.h. * src/main.c (main) [C_ALLOCA]: Call alloca (0). --- diff --git a/ChangeLog b/ChangeLog index 19c9251a..0ae8e768 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-11-23 Akim Demaille + + * src/system.h: Include alloca.h. + * src/main.c (main) [C_ALLOCA]: Call alloca (0). + 2001-11-23 Akim Demaille * src/print_graph.c (print_actions): Remove `rule', unused. @@ -6,7 +11,6 @@ * src/closure.c (itemsetsize): Likewise. * src/reader.c (symbol_list_new): Static. - 2001-11-23 Akim Demaille Attaching lineno to buckets is stupid, since only one copy of each diff --git a/src/main.c b/src/main.c index 62436a80..33994c9b 100644 --- a/src/main.c +++ b/src/main.c @@ -117,6 +117,12 @@ main (int argc, char *argv[]) output_files (); + /* If using alloca.c, flush the alloca'ed memory for the benefit of + people running Bison as a library in IDEs. */ +#if C_ALLOCA + alloca (0); +#endif + return complain_message_count ? EXIT_FAILURE : EXIT_SUCCESS; } diff --git a/src/system.h b/src/system.h index b8a73edb..93213cb7 100644 --- a/src/system.h +++ b/src/system.h @@ -79,6 +79,21 @@ extern int errno; #endif +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif + #if PROTOTYPES # define PARAMS(p) p #else