From fe535a159481b05214585f06cabaf9b0fa997892 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 12 Jan 2011 18:44:29 +0100 Subject: [PATCH] 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. --- ChangeLog | 18 ++++++++++ iface/nips/nips.cc | 26 +++++++------- src/eltlparse/Makefile.am | 7 ++-- src/eltlparse/eltlparse.yy | 70 ++++++++++++++++++++----------------- src/evtgbaparse/Makefile.am | 6 ++-- src/ltlparse/Makefile.am | 6 ++-- src/neverparse/Makefile.am | 4 +-- src/tgbaparse/Makefile.am | 6 ++-- 8 files changed, 84 insertions(+), 59 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c74054d0..646c7184a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,23 @@ 2011-01-12 Alexandre Duret-Lutz + 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 + + Fix segfault with g++-3.3. * src/tgbaalgos/minimize.cc (minimize_dfa): Fix deletion of the diff --git a/iface/nips/nips.cc b/iface/nips/nips.cc index 5dc4a8263..eca60dd45 100644 --- a/iface/nips/nips.cc +++ b/iface/nips/nips.cc @@ -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). // // This file is part of Spot, a model checking library. @@ -49,18 +49,18 @@ namespace spot } // Callback for error which fails on assertions - nipsvm_status_t - search_error_callback_assert(nipsvm_errorcode_t err, nipsvm_pid_t pid, - nipsvm_pc_t pc, void *) - { - char str[256]; - - nipsvm_errorstring (str, sizeof str, err, pid, pc); - std::cerr << "RUNTIME ERROR (" << err << "): " << str << std::endl; - - throw nips_exception(std::string(str), static_cast(err)); - return IC_STOP; - } + // nipsvm_status_t + // search_error_callback_assert(nipsvm_errorcode_t err, nipsvm_pid_t pid, + // nipsvm_pc_t pc, void *) + // { + // char str[256]; + // + // nipsvm_errorstring (str, sizeof str, err, pid, pc); + // std::cerr << "RUNTIME ERROR (" << err << "): " << str << std::endl; + // + // throw nips_exception(std::string(str), static_cast(err)); + // return IC_STOP; + // } // state_nips ////////////////////////////////////////////////////////////////////// diff --git a/src/eltlparse/Makefile.am b/src/eltlparse/Makefile.am index 1df11f572..d7d1e6f81 100644 --- a/src/eltlparse/Makefile.am +++ b/src/eltlparse/Makefile.am @@ -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). ## ## This file is part of Spot, a model checking library. @@ -18,8 +18,9 @@ ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -AM_CPPFLAGS = -I$(srcdir)/.. -AM_CXXFLAGS = #$(WARNING_CXXFLAGS) +AM_CPPFLAGS = -I$(srcdir)/.. -DYY_NO_INPUT +# Disable -Werror because too many versions of flex yield warnings. +AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=) eltlparsedir = $(pkgincludedir)/eltlparse diff --git a/src/eltlparse/eltlparse.yy b/src/eltlparse/eltlparse.yy index 2ab4971e2..7ebb3ade9 100644 --- a/src/eltlparse/eltlparse.yy +++ b/src/eltlparse/eltlparse.yy @@ -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). ** ** This file is part of Spot, a model checking library. @@ -56,7 +56,43 @@ namespace spot parse_error_list list_; 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; /// 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. */ %token ATOMIC_PROP "atomic proposition" @@ -455,7 +461,7 @@ subformula: ATOMIC_PROP nfa::ptr np = nmap[*$1]; /// Easily handle deletion of $3 when CHECK_ARITY fails. - int i = $3->size(); + unsigned i = $3->size(); if ($3->size() != np->arity()) { automatop::vec::iterator it = $3->begin(); diff --git a/src/evtgbaparse/Makefile.am b/src/evtgbaparse/Makefile.am index 63378908c..69b08fa79 100644 --- a/src/evtgbaparse/Makefile.am +++ b/src/evtgbaparse/Makefile.am @@ -1,5 +1,5 @@ -## Copyright (C) 2008, 2009 Laboratoire de Recherche et Développement -## de l'Epita (LRDE). +## Copyright (C) 2008, 2009, 2011 Laboratoire de Recherche et +## Développement de l'Epita (LRDE). ## Copyright (C) 2004, 2006 Laboratoire d'Informatique de Paris 6 ## (LIP6), département Systèmes Répartis Coopératifs (SRC), Université ## Pierre et Marie Curie. @@ -21,7 +21,7 @@ ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 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. AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=) diff --git a/src/ltlparse/Makefile.am b/src/ltlparse/Makefile.am index e815ba04e..753afbee1 100644 --- a/src/ltlparse/Makefile.am +++ b/src/ltlparse/Makefile.am @@ -1,5 +1,5 @@ -## Copyright (C) 2008, 2009, 2010 Laboratoire de Recherche et Développement -## de l'Epita (LRDE). +## Copyright (C) 2008, 2009, 2010, 2011 Laboratoire de Recherche et +## Développement de l'Epita (LRDE). ## Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris ## 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), ## Université Pierre et Marie Curie. @@ -21,7 +21,7 @@ ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -AM_CPPFLAGS = -I$(srcdir)/.. +AM_CPPFLAGS = -I$(srcdir)/.. -DYY_NO_INPUT # Disable -Werror because too many versions of flex yield warnings. AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=) diff --git a/src/neverparse/Makefile.am b/src/neverparse/Makefile.am index 4a80ec2fa..855c82431 100644 --- a/src/neverparse/Makefile.am +++ b/src/neverparse/Makefile.am @@ -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). ## ## This file is part of Spot, a model checking library. @@ -18,7 +18,7 @@ ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 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. AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=) diff --git a/src/tgbaparse/Makefile.am b/src/tgbaparse/Makefile.am index ee61ea01a..5b850eca1 100644 --- a/src/tgbaparse/Makefile.am +++ b/src/tgbaparse/Makefile.am @@ -1,5 +1,5 @@ -## Copyright (C) 2008, 2009 Laboratoire de Recherche et Développement -## de l'Epita (LRDE). +## Copyright (C) 2008, 2009, 2011 Laboratoire de Recherche et +## Développement de l'Epita (LRDE). ## Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de ## Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), ## Université Pierre et Marie Curie. @@ -21,7 +21,7 @@ ## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 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. AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=)