Fix "unused function" warnings reported by clang++.

* src/evtgbaparse/Makefile.am, src/ltlparse/Makefile.am,
src/neverparse/Makefile.am, src/tgbaparse/Makefile.am
(AM_CPPFLAGS): Define -DYY_NO_INPUT so that the unused yyinput()
function does not get compiled.
* src/eltlparse/Makefile.am (AM_CPPFLAGS): Likewise.
(AM_CXXFLAGS): Also enable warnings.
* src/eltlparse/eltlparse.yy: Move helper functions from
the "%code requires" block to the "%code" block, so that they
do not appear in the eltlparse.hh file (which is included in
two places...).
* iface/nips/nips.cc (search_error_callback_assert): Comment
this unused function.
This commit is contained in:
Alexandre Duret-Lutz 2011-01-12 18:44:29 +01:00
parent 45d7c88062
commit fe535a1594
8 changed files with 84 additions and 59 deletions

View file

@ -1,5 +1,23 @@
2011-01-12 Alexandre Duret-Lutz <adl@lrde.epita.fr> 2011-01-12 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Fix "unused function" warnings reported by clang++.
* src/evtgbaparse/Makefile.am, src/ltlparse/Makefile.am,
src/neverparse/Makefile.am, src/tgbaparse/Makefile.am
(AM_CPPFLAGS): Define -DYY_NO_INPUT so that the unused yyinput()
function does not get compiled.
* src/eltlparse/Makefile.am (AM_CPPFLAGS): Likewise.
(AM_CXXFLAGS): Also enable warnings.
* src/eltlparse/eltlparse.yy: Move helper functions from
the "%code requires" block to the "%code" block, so that they
do not appear in the eltlparse.hh file (which is included in
two places...).
* iface/nips/nips.cc (search_error_callback_assert): Comment
this unused function.
2011-01-12 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Fix segfault with g++-3.3. Fix segfault with g++-3.3.
* src/tgbaalgos/minimize.cc (minimize_dfa): Fix deletion of the * src/tgbaalgos/minimize.cc (minimize_dfa): Fix deletion of the

View file

@ -1,4 +1,4 @@
// Copyright (C) 2008, 2010 Laboratoire de Recherche et Développement // Copyright (C) 2008, 2010, 2011 Laboratoire de Recherche et Développement
// de l'Epita (LRDE). // de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -49,18 +49,18 @@ namespace spot
} }
// Callback for error which fails on assertions // Callback for error which fails on assertions
nipsvm_status_t // nipsvm_status_t
search_error_callback_assert(nipsvm_errorcode_t err, nipsvm_pid_t pid, // search_error_callback_assert(nipsvm_errorcode_t err, nipsvm_pid_t pid,
nipsvm_pc_t pc, void *) // nipsvm_pc_t pc, void *)
{ // {
char str[256]; // char str[256];
//
nipsvm_errorstring (str, sizeof str, err, pid, pc); // nipsvm_errorstring (str, sizeof str, err, pid, pc);
std::cerr << "RUNTIME ERROR (" << err << "): " << str << std::endl; // std::cerr << "RUNTIME ERROR (" << err << "): " << str << std::endl;
//
throw nips_exception(std::string(str), static_cast<int>(err)); // throw nips_exception(std::string(str), static_cast<int>(err));
return IC_STOP; // return IC_STOP;
} // }
// state_nips // state_nips
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -1,4 +1,4 @@
## Copyright (C) 2008 Laboratoire de Recherche et Développement ## Copyright (C) 2008, 2011 Laboratoire de Recherche et Développement
## de l'Epita (LRDE). ## de l'Epita (LRDE).
## ##
## This file is part of Spot, a model checking library. ## This file is part of Spot, a model checking library.
@ -18,8 +18,9 @@
## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA. ## 02111-1307, USA.
AM_CPPFLAGS = -I$(srcdir)/.. AM_CPPFLAGS = -I$(srcdir)/.. -DYY_NO_INPUT
AM_CXXFLAGS = #$(WARNING_CXXFLAGS) # Disable -Werror because too many versions of flex yield warnings.
AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=)
eltlparsedir = $(pkgincludedir)/eltlparse eltlparsedir = $(pkgincludedir)/eltlparse

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2008, 2009, 2010 Laboratoire de Recherche et /* Copyright (C) 2008, 2009, 2010, 2011 Laboratoire de Recherche et
** Développement de l'Epita (LRDE). ** Développement de l'Epita (LRDE).
** **
** This file is part of Spot, a model checking library. ** This file is part of Spot, a model checking library.
@ -56,7 +56,43 @@ namespace spot
parse_error_list list_; parse_error_list list_;
std::string file_; std::string file_;
}; };
}
}
}
%parse-param {spot::eltl::nfamap& nmap}
%parse-param {spot::eltl::aliasmap& amap}
%parse-param {spot::eltl::parse_error_list_t &pe}
%parse-param {spot::ltl::environment &parse_environment}
%parse-param {spot::ltl::formula* &result}
%lex-param {spot::eltl::parse_error_list_t &pe}
%expect 0
%pure-parser
%union
{
int ival;
std::string* sval;
spot::ltl::nfa* nval;
spot::ltl::automatop::vec* aval;
spot::ltl::formula* fval;
/// To handle aliases.
spot::ltl::formula_tree::node* pval;
spot::ltl::formula_tree::node_nfa* bval;
}
%code {
/* ltlparse.hh and parsedecl.hh include each other recursively.
We mut ensure that YYSTYPE is declared (by the above %union)
before parsedecl.hh uses it. */
#include "parsedecl.hh"
using namespace spot::eltl;
using namespace spot::ltl;
namespace spot
{
namespace eltl
{
using namespace spot::ltl::formula_tree; using namespace spot::ltl::formula_tree;
/// Alias an existing alias, as in Strong=G(F($0))->G(F($1)), /// Alias an existing alias, as in Strong=G(F($0))->G(F($1)),
@ -159,36 +195,6 @@ namespace spot
} }
%parse-param {spot::eltl::nfamap& nmap}
%parse-param {spot::eltl::aliasmap& amap}
%parse-param {spot::eltl::parse_error_list_t &pe}
%parse-param {spot::ltl::environment &parse_environment}
%parse-param {spot::ltl::formula* &result}
%lex-param {spot::eltl::parse_error_list_t &pe}
%expect 0
%pure-parser
%union
{
int ival;
std::string* sval;
spot::ltl::nfa* nval;
spot::ltl::automatop::vec* aval;
spot::ltl::formula* fval;
/// To handle aliases.
spot::ltl::formula_tree::node* pval;
spot::ltl::formula_tree::node_nfa* bval;
}
%code {
/* ltlparse.hh and parsedecl.hh include each other recursively.
We mut ensure that YYSTYPE is declared (by the above %union)
before parsedecl.hh uses it. */
#include "parsedecl.hh"
using namespace spot::eltl;
using namespace spot::ltl;
}
/* All tokens. */ /* All tokens. */
%token <sval> ATOMIC_PROP "atomic proposition" %token <sval> ATOMIC_PROP "atomic proposition"
@ -455,7 +461,7 @@ subformula: ATOMIC_PROP
nfa::ptr np = nmap[*$1]; nfa::ptr np = nmap[*$1];
/// Easily handle deletion of $3 when CHECK_ARITY fails. /// Easily handle deletion of $3 when CHECK_ARITY fails.
int i = $3->size(); unsigned i = $3->size();
if ($3->size() != np->arity()) if ($3->size() != np->arity())
{ {
automatop::vec::iterator it = $3->begin(); automatop::vec::iterator it = $3->begin();

View file

@ -1,5 +1,5 @@
## Copyright (C) 2008, 2009 Laboratoire de Recherche et Développement ## Copyright (C) 2008, 2009, 2011 Laboratoire de Recherche et
## de l'Epita (LRDE). ## Développement de l'Epita (LRDE).
## Copyright (C) 2004, 2006 Laboratoire d'Informatique de Paris 6 ## Copyright (C) 2004, 2006 Laboratoire d'Informatique de Paris 6
## (LIP6), département Systèmes Répartis Coopératifs (SRC), Université ## (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
## Pierre et Marie Curie. ## Pierre et Marie Curie.
@ -21,7 +21,7 @@
## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA. ## 02111-1307, USA.
AM_CPPFLAGS = -I$(srcdir)/.. $(BUDDY_CPPFLAGS) AM_CPPFLAGS = -I$(srcdir)/.. $(BUDDY_CPPFLAGS) -DYY_NO_INPUT
# Disable -Werror because too many versions of flex yield warnings. # Disable -Werror because too many versions of flex yield warnings.
AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=) AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=)

View file

@ -1,5 +1,5 @@
## Copyright (C) 2008, 2009, 2010 Laboratoire de Recherche et Développement ## Copyright (C) 2008, 2009, 2010, 2011 Laboratoire de Recherche et
## de l'Epita (LRDE). ## Développement de l'Epita (LRDE).
## Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris ## Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris
## 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), ## 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
## Université Pierre et Marie Curie. ## Université Pierre et Marie Curie.
@ -21,7 +21,7 @@
## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA. ## 02111-1307, USA.
AM_CPPFLAGS = -I$(srcdir)/.. AM_CPPFLAGS = -I$(srcdir)/.. -DYY_NO_INPUT
# Disable -Werror because too many versions of flex yield warnings. # Disable -Werror because too many versions of flex yield warnings.
AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=) AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=)

View file

@ -1,4 +1,4 @@
## Copyright (C) 2010 Laboratoire de Recherche et Développement ## Copyright (C) 2010, 2011 Laboratoire de Recherche et Développement
## de l'Epita (LRDE). ## de l'Epita (LRDE).
## ##
## This file is part of Spot, a model checking library. ## This file is part of Spot, a model checking library.
@ -18,7 +18,7 @@
## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA. ## 02111-1307, USA.
AM_CPPFLAGS = -I$(srcdir)/.. $(BUDDY_CPPFLAGS) AM_CPPFLAGS = -I$(srcdir)/.. $(BUDDY_CPPFLAGS) -DYY_NO_INPUT
# Disable -Werror because too many versions of flex yield warnings. # Disable -Werror because too many versions of flex yield warnings.
AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=) AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=)

View file

@ -1,5 +1,5 @@
## Copyright (C) 2008, 2009 Laboratoire de Recherche et Développement ## Copyright (C) 2008, 2009, 2011 Laboratoire de Recherche et
## de l'Epita (LRDE). ## Développement de l'Epita (LRDE).
## Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de ## Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de
## Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), ## Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
## Université Pierre et Marie Curie. ## Université Pierre et Marie Curie.
@ -21,7 +21,7 @@
## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA. ## 02111-1307, USA.
AM_CPPFLAGS = -I$(srcdir)/.. $(BUDDY_CPPFLAGS) AM_CPPFLAGS = -I$(srcdir)/.. $(BUDDY_CPPFLAGS) -DYY_NO_INPUT
# Disable -Werror because too many versions of flex yield warnings. # Disable -Werror because too many versions of flex yield warnings.
AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=) AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=)