COIN-OR::LEMON - Graph Library

Changeset 1197:f179aa1045a4 in lemon-main


Ignore:
Timestamp:
11/01/18 11:27:05 (6 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Suppress unused typdef warnings (#615)

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1180 r1197  
    149149ENDIF()
    150150
     151IF( ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND
     152      ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL "4.8") )
     153    OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     154    OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
     155    )
     156  SET(LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS TRUE)
     157ENDIF()
    151158
    152159IF(DEFINED ENV{LEMON_CXX_WARNING})
    153160  SET(CXX_WARNING $ENV{LEMON_CXX_WARNING})
    154161ELSE()
    155   IF(CMAKE_COMPILER_IS_GNUCXX)
     162  IF( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
     163      OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     164      )
    156165    SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas")
     166    SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
     167    SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
     168  ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
     169    SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wno-unknown-pragmas")
    157170    SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb")
    158171    SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb")
  • lemon/bfs.h

    r1092 r1197  
    13771377    struct SetReachedMapTraits : public Traits {
    13781378      typedef T ReachedMap;
    1379       static ReachedMap *createReachedMap(const Digraph &digraph) {
     1379      static ReachedMap *createReachedMap(const Digraph &) {
    13801380        LEMON_ASSERT(false, "ReachedMap is not initialized");
    13811381        return 0; // ignore warnings
  • lemon/concepts/graph_components.h

    r1092 r1197  
    104104          i1=INVALID;
    105105          _GraphItem i2 = i1;
     106          ::lemon::ignore_unused_variable_warning(i2);
    106107          _GraphItem i3 = INVALID;
    107108
     
    735736
    736737          Item bi = it1;
     738          ::lemon::ignore_unused_variable_warning(bi);
    737739          bi = it2;
    738740        }
     
    825827          ++(++it1);
    826828          Item e = it1;
     829          ::lemon::ignore_unused_variable_warning(e);
    827830          e = it2;
    828831        }
  • lemon/concepts/path.h

    r1092 r1197  
    7171      /// \brief Template copy constructor
    7272      template <typename CPath>
    73       Path(const CPath& cpath) {}
     73      Path(const CPath& cpath) {
     74        ::lemon::ignore_unused_variable_warning(cpath);
     75      }
    7476
    7577      /// \brief Template assigment operator
  • lemon/config.h.in

    r1134 r1197  
    33
    44#define LEMON_VERSION "@PROJECT_VERSION@"
     5
    56#cmakedefine LEMON_HAVE_LONG_LONG 1
    67
     
    2728#cmakedefine LEMON_USE_WIN32_THREADS 1
    2829
     30#cmakedefine LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS 1
     31
    2932#endif
  • lemon/core.h

    r1135 r1197  
    3434// C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
    3535// C4996: 'function': was declared deprecated
     36
     37#include <lemon/config.h>
     38
    3639#ifdef _MSC_VER
    3740#pragma warning( disable : 4250 4267 4355 4503 4800 4996 )
    3841#endif
    3942
    40 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
    41 // Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8
     43#if LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS
     44// Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc >=4.8 and clang
    4245#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
    4346#endif
     
    4649#include <algorithm>
    4750
    48 #include <lemon/config.h>
    4951#include <lemon/bits/enable_if.h>
    5052#include <lemon/bits/traits.h>
  • lemon/dfs.h

    r1092 r1197  
    13191319    struct SetReachedMapTraits : public Traits {
    13201320      typedef T ReachedMap;
    1321       static ReachedMap *createReachedMap(const Digraph &digraph) {
     1321      static ReachedMap *createReachedMap(const Digraph &) {
    13221322        LEMON_ASSERT(false, "ReachedMap is not initialized");
    13231323        return 0; // ignore warnings
  • lemon/nagamochi_ibaraki.h

    r1092 r1197  
    175175      typedef CR HeapCrossRef;
    176176      typedef H Heap;
    177       static HeapCrossRef *createHeapCrossRef(int num) {
     177      static HeapCrossRef *createHeapCrossRef(int) {
    178178        LEMON_ASSERT(false, "HeapCrossRef is not initialized");
    179179        return 0; // ignore warnings
  • test/adaptors_test.cc

    r1092 r1197  
    146146  // Check the conversion of nodes and arcs
    147147  Digraph::Node nd = n4;
     148  ::lemon::ignore_unused_variable_warning(nd);
    148149  nd = n4;
    149150  Adaptor::Node na = n1;
     151  ::lemon::ignore_unused_variable_warning(na);
    150152  na = n2;
    151153  Digraph::Arc ad = a4;
     154  ::lemon::ignore_unused_variable_warning(ad);
    152155  ad = a5;
    153156  Adaptor::Arc aa = a1;
     157  ::lemon::ignore_unused_variable_warning(aa);
    154158  aa = a2;
    155159}
     
    270274  // Check the conversion of nodes and arcs
    271275  Digraph::Node nd = n3;
     276  ::lemon::ignore_unused_variable_warning(nd);
    272277  nd = n3;
    273278  Adaptor::Node na = n1;
     279  ::lemon::ignore_unused_variable_warning(na);
    274280  na = n2;
    275281  Digraph::Arc ad = a3;
     282  ::lemon::ignore_unused_variable_warning(ad);
    276283  ad = a3;
    277284  Adaptor::Arc aa = a1;
     285  ::lemon::ignore_unused_variable_warning(aa);
    278286  aa = a2;
    279287}
     
    366374  // Check the conversion of nodes and arcs
    367375  Digraph::Node nd = n3;
     376  ::lemon::ignore_unused_variable_warning(nd);
    368377  nd = n3;
    369378  Adaptor::Node na = n1;
     379  ::lemon::ignore_unused_variable_warning(na);
    370380  na = n2;
    371381  Digraph::Arc ad = a3;
     382  ::lemon::ignore_unused_variable_warning(ad);
    372383  ad = a3;
    373384  Adaptor::Arc aa = a1;
     385  ::lemon::ignore_unused_variable_warning(aa);
    374386  aa = a2;
    375387}
     
    464476  // Check the conversion of nodes and arcs
    465477  Digraph::Node nd = n3;
     478  ::lemon::ignore_unused_variable_warning(nd);
    466479  nd = n3;
    467480  Adaptor::Node na = n1;
     481  ::lemon::ignore_unused_variable_warning(na);
    468482  na = n2;
    469483  Digraph::Arc ad = a3;
     484  ::lemon::ignore_unused_variable_warning(ad);
    470485  ad = a3;
    471486  Adaptor::Arc aa = a1;
     487  ::lemon::ignore_unused_variable_warning(aa);
    472488  aa = a2;
    473489}
     
    575591  // Check the conversion of nodes and arcs/edges
    576592  Digraph::Node nd = n3;
     593  ::lemon::ignore_unused_variable_warning(nd);
    577594  nd = n3;
    578595  Adaptor::Node na = n1;
     596  ::lemon::ignore_unused_variable_warning(na);
    579597  na = n2;
    580598  Digraph::Arc ad = e3;
     599  ::lemon::ignore_unused_variable_warning(ad);
    581600  ad = e3;
    582601  Adaptor::Edge ea = a1;
     602  ::lemon::ignore_unused_variable_warning(ea);
    583603  ea = a2;
    584604}
     
    735755  // Check the conversion of nodes and arcs
    736756  Digraph::Node nd = Adaptor::NodeIt(adaptor);
     757  ::lemon::ignore_unused_variable_warning(nd);
    737758  nd = ++Adaptor::NodeIt(adaptor);
    738759  Adaptor::Node na = n1;
     760  ::lemon::ignore_unused_variable_warning(na);
    739761  na = n2;
    740762  Digraph::Arc ad = Adaptor::ArcIt(adaptor);
     763  ::lemon::ignore_unused_variable_warning(ad);
    741764  ad = ++Adaptor::ArcIt(adaptor);
    742765}
     
    9881011  // Check the conversion of nodes and edges
    9891012  Graph::Node ng = n3;
     1013  ::lemon::ignore_unused_variable_warning(ng);
    9901014  ng = n4;
    9911015  Adaptor::Node na = n1;
     1016  ::lemon::ignore_unused_variable_warning(na);
    9921017  na = n2;
    9931018  Graph::Edge eg = e3;
     1019  ::lemon::ignore_unused_variable_warning(eg);
    9941020  eg = e4;
    9951021  Adaptor::Edge ea = e1;
     1022  ::lemon::ignore_unused_variable_warning(ea);
    9961023  ea = e2;
    9971024}
     
    10931120  // Check the conversion of nodes and edges
    10941121  Graph::Node ng = n3;
     1122  ::lemon::ignore_unused_variable_warning(ng);
    10951123  ng = n4;
    10961124  Adaptor::Node na = n1;
     1125  ::lemon::ignore_unused_variable_warning(na);
    10971126  na = n2;
    10981127  Graph::Edge eg = e3;
     1128  ::lemon::ignore_unused_variable_warning(eg);
    10991129  eg = e4;
    11001130  Adaptor::Edge ea = e1;
     1131  ::lemon::ignore_unused_variable_warning(ea);
    11011132  ea = e2;
    11021133}
     
    11991230  // Check the conversion of nodes and edges
    12001231  Graph::Node ng = n3;
     1232  ::lemon::ignore_unused_variable_warning(ng);
    12011233  ng = n4;
    12021234  Adaptor::Node na = n1;
     1235  ::lemon::ignore_unused_variable_warning(na);
    12031236  na = n2;
    12041237  Graph::Edge eg = e3;
     1238  ::lemon::ignore_unused_variable_warning(eg);
    12051239  eg = e4;
    12061240  Adaptor::Edge ea = e1;
     1241  ::lemon::ignore_unused_variable_warning(ea);
    12071242  ea = e2;
    12081243}
     
    13571392  // Check the conversion of nodes and arcs/edges
    13581393  Graph::Node ng = n3;
     1394  ::lemon::ignore_unused_variable_warning(ng);
    13591395  ng = n3;
    13601396  Adaptor::Node na = n1;
     1397  ::lemon::ignore_unused_variable_warning(na);
    13611398  na = n2;
    13621399  Graph::Edge eg = e3;
     1400  ::lemon::ignore_unused_variable_warning(eg);
    13631401  eg = e3;
    13641402  Adaptor::Arc aa = e1;
     1403  ::lemon::ignore_unused_variable_warning(aa);
    13651404  aa = e2;
    13661405}
Note: See TracChangeset for help on using the changeset viewer.