* data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !

YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
__cplusplus && ! defined _STDLIB_H && !
((defined YYMALLOC || defined malloc) && (defined YYFREE ||
defined free))]: Include <stdlib.h> rather than rolling our own
declarations of malloc and free, to avoid problems with
incompatible declarations (using 'throw') C++'s stdlib.h.  This
should fix Debian bug 340012
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
reported by Guillaume Melquiond.
This commit is contained in:
Paul Eggert
2006-02-17 00:08:17 +00:00
parent 4d7bc38cdc
commit fc3f467ff1
2 changed files with 20 additions and 5 deletions

View File

@@ -1,3 +1,16 @@
2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
* data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
__cplusplus && ! defined _STDLIB_H && !
((defined YYMALLOC || defined malloc) && (defined YYFREE ||
defined free))]: Include <stdlib.h> rather than rolling our own
declarations of malloc and free, to avoid problems with
incompatible declarations (using 'throw') C++'s stdlib.h. This
should fix Debian bug 340012
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
reported by Guillaume Melquiond.
2006-02-13 Paul Eggert <eggert@cs.ucla.edu> 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: Clarify symbols versus types in unused-value warnings. * NEWS: Clarify symbols versus types in unused-value warnings.

View File

@@ -338,8 +338,13 @@ typedef short int yytype_int16;
# ifndef YYSTACK_ALLOC_MAXIMUM # ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif # endif
# ifdef __cplusplus # if (defined __cplusplus && ! defined _STDLIB_H \
extern "C" { && ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef _STDLIB_H
# define _STDLIB_H 1
# endif
# endif # endif
# ifndef YYMALLOC # ifndef YYMALLOC
# define YYMALLOC malloc # define YYMALLOC malloc
@@ -353,9 +358,6 @@ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
void free (void *); /* INFRINGES ON USER NAME SPACE */ void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif # endif
# endif # endif
# ifdef __cplusplus
}
# endif
# endif # endif
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #endif /* ! defined yyoverflow || YYERROR_VERBOSE */