mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
c++: use nullptr for C++11.
C++11 introduces "nullptr" which plays the role of C's NULL, in
replacement of "0". Fix the C++ skeletons to avoid warnings about
uses of "0" in place of "nullptr", and improve C skeletons to also use
this "nullptr" when compiled with a C++11 compiler.
* configure.ac: More C++ warnings.
* NEWS (2.5.1): Document this.
* data/c++.m4, data/c.m4 (b4_null_define): New.
(b4_null): Use YY_NULL instead of 0.
* data/glr.c, data/lalr1.cc, data/location.cc, data/yacc.c:
Call b4_null_define/b4_null where appropriate.
Use YY_NULL instead of NULL.
* data/location.cc (initialize): Accept a default argument,
YY_NULL.
* tests/actions.at, tests/calc.at: Adjust.
* data/glr.c, lib/libiberty.h, src/system.h (__attribute__):
Do not disable it when __STRICT_ANSI__ is defined, as, for
instance, it disables the __attribute__((unused)) which
protects us from some compiler warnings.
This was already done elsewhere in Bison, in 2001, see
4a0d893695.
* tests/regression.at: Adjust output.
This commit is contained in:
@@ -345,7 +345,7 @@ thing:
|
||||
;
|
||||
%%
|
||||
/* Alias to ARGV[1]. */
|
||||
const char *source = 0;
|
||||
const char *source = YY_NULL;
|
||||
|
||||
static int
|
||||
yylex (]AT_LEX_FORMALS[)
|
||||
|
||||
@@ -241,7 +241,7 @@ int yylex (]AT_LEX_FORMALS[);
|
||||
are stored in a union, from which objects with constructors are
|
||||
excluded in C++. */
|
||||
%initial-action {
|
||||
@$.initialize (0);
|
||||
@$.initialize ();
|
||||
}
|
||||
])])[
|
||||
|
||||
|
||||
@@ -769,7 +769,7 @@ static const yytype_uint8 yyrline[] =
|
||||
static const char *const yytname[] =
|
||||
{
|
||||
"$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"",
|
||||
"\"else\"", "$accept", "statement", "struct_stat", "if", "else", 0
|
||||
"\"else\"", "$accept", "statement", "struct_stat", "if", "else", YY_NULL
|
||||
};
|
||||
static const yytype_uint16 yytoknum[] =
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user