Mercurial > octave
diff libinterp/corefcn/oct-tex-lexer.in.ll @ 21023:ec532a439c6f
rework method of disabling warnings from GCC
* configure.ac: Check for GCC's #pragma GCC diagnostic feature.
* libinterp/module.mk, libinterp/corefcn/module.mk,
libinterp/parse-tree/module.mk: Eliminate separate libraries for TeX
and Octave parsers.
* oct-tex-lexer.in.ll, oct-tex-parser.in.yy, lex.ll, oct-parse.in.yy:
Use GCC #pragma GCC diagnostic feature to more selectively disable
warnings in generated code.
* libgui/module.mk (rcc-command): Use GCC #pragma GCC diagnostic
feature to more selectively disable warnings in generated code.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 31 Dec 2015 17:06:36 -0500 |
parents | e3c0fee87493 |
children | 40de9f8f23a6 |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-tex-lexer.in.ll Thu Dec 31 13:45:43 2015 -0500 +++ b/libinterp/corefcn/oct-tex-lexer.in.ll Thu Dec 31 17:06:36 2015 -0500 @@ -20,6 +20,24 @@ */ +%top { +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +// This one needs to be global. +#pragma GCC diagnostic ignored "-Wunused-function" + +// Disable this warning for code that is generated by flex, including +// pattern rules. Push the current state so we can restore the warning +// state prior to functions we define at the bottom of the file. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" +#endif + +} + %option prefix = "octave_tex_" %option noyywrap %option reentrant @@ -29,13 +47,6 @@ %option noyyrealloc %option noyyfree -%top { -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -} - %x NUM_MODE %x MAYBE_NUM_MODE @@ -171,8 +182,21 @@ return CH; } +%{ +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +// Also disable this warning for functions that is generated by flex +// after the pattern rules. +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif +%} + %% +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +// Restore prevailing warning state for remainder of the file. +#pragma GCC diagnostic pop +#endif + void * octave_tex_alloc (yy_size_t size, yyscan_t) {