From: Paul Eggert Date: Fri, 17 Feb 2006 00:08:17 +0000 (+0000) Subject: * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && ! X-Git-Tag: v2.3b~447 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/fc3f467ff12133962ef69f58e60cb24fc29cc929?ds=sidebyside;hp=4d7bc38cdcb1fb457dfd34fdf7c81e507a002867 * 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 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 , reported by Guillaume Melquiond. --- diff --git a/ChangeLog b/ChangeLog index e9201f03..c8d3e981 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2006-02-16 Paul Eggert + + * 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 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 + , + reported by Guillaume Melquiond. + 2006-02-13 Paul Eggert * NEWS: Clarify symbols versus types in unused-value warnings. diff --git a/data/yacc.c b/data/yacc.c index a6aaef58..6f847177 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -338,8 +338,13 @@ typedef short int yytype_int16; # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# ifdef __cplusplus -extern "C" { +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif # endif # ifndef YYMALLOC # define YYMALLOC malloc @@ -353,9 +358,6 @@ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif -# ifdef __cplusplus -} -# endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */