From e86370f894ee62e4c238784a6b5eec2d7ce93e44 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 16 Feb 2016 16:04:03 +0100 Subject: [PATCH] Turn on some new warnings from GCC 6.0 * m4/gccwarn.m4: Add the new warnings. * spot/ta/taexplicit.cc, spot/ta/taproduct.cc: Add missing asserts. --- m4/gccwarn.m4 | 6 +++++- spot/ta/taexplicit.cc | 7 ++++--- spot/ta/taproduct.cc | 5 +++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/m4/gccwarn.m4 b/m4/gccwarn.m4 index 6c83bc35d..0198a1720 100644 --- a/m4/gccwarn.m4 +++ b/m4/gccwarn.m4 @@ -35,7 +35,11 @@ EOF Wdocumentation \ Wmissing-declarations \ Wnoexcept \ - Woverloaded-virtual + Woverloaded-virtual \ + Wmisleading-indentation \ + Wlogical-op \ + Wduplicated-cond \ + Wnull-dereference do CXXFLAGS="$cf_save_CXXFLAGS $ac_cv_prog_gxx_warn_flags -$cf_opt" if AC_TRY_EVAL(ac_compile); then diff --git a/spot/ta/taexplicit.cc b/spot/ta/taexplicit.cc index 77c438350..2d571b9da 100644 --- a/spot/ta/taexplicit.cc +++ b/spot/ta/taexplicit.cc @@ -1,6 +1,6 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire de -// Recherche et Développement de l'Epita (LRDE). +// Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 Laboratoire +// de Recherche et Développement de l'Epita (LRDE). // // This file is part of Spot, a model checking library. // @@ -362,7 +362,7 @@ namespace spot { auto* s = const_cast (down_cast(*it)); - + assert(s); s->free_transitions(); s->get_tgba_state()->destroy(); delete s; @@ -383,6 +383,7 @@ namespace spot ta_explicit::add_to_initial_states_set(state* state, bdd condition) { state_ta_explicit* s = down_cast(state); + assert(s); s->set_initial_state(true); if (condition == bddfalse) condition = get_state_condition(s); diff --git a/spot/ta/taproduct.cc b/spot/ta/taproduct.cc index 86d84c052..c57fd3a6d 100644 --- a/spot/ta/taproduct.cc +++ b/spot/ta/taproduct.cc @@ -1,6 +1,6 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2011, 2012, 2014, 2015 Laboratoire de Recherche et -// Développement de l'Epita (LRDE). +// Copyright (C) 2011, 2012, 2014, 2015, 2016 Laboratoire de Recherche +// et Développement de l'Epita (LRDE). // // // This file is part of Spot, a model checking library. @@ -373,6 +373,7 @@ namespace spot ta_product::is_hole_state_in_ta_component(const spot::state* s) const { const state_ta_product* stp = down_cast (s); + assert(stp); ta_succ_iterator* ta_succ_iter = get_ta()->succ_iter(stp->get_ta_state()); bool is_hole_state = ta_succ_iter->done(); delete ta_succ_iter; -- GitLab