c++: use __attribute__((__pure__)) to avoid warnings

Building C++ parsers with -Wsuggest-attribute=const and
-Wsuggest-attribute=noreturn triggers warning in generated code.

* data/lalr1.cc: Call b4_attribute_define.
(debug_stream, debug_level): Flag as pure.
* tests/headers.at (Several parsers): There are now more YY macros
that "leak".
This commit is contained in:
Akim Demaille
2013-10-23 10:57:51 +02:00
parent 3cc83855d9
commit ad9d4f9f2e
2 changed files with 8 additions and 3 deletions

View File

@@ -223,7 +223,11 @@ AT_CHECK([[$PERL -n -0777 -e '
s{/\*.*?\*/}{}gs;
s{//.*}{}g;
s{\b(YYChar
|YYPUSH_MORE(_DEFINED)?
|YYPUSH_MORE(?:_DEFINED)?
|YYUSE
|YY_ATTRIBUTE(?:_PURE|_UNUSED)?
|YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
|YY_INITIAL_VALUE
|YY_\w+_INCLUDED
|YY_NULL
|(defined|if)\ YYDEBUG