# HG changeset patch
# User Alpar Juttner <alpar@cs.elte.hu>
# Date 1540981897 -3600
# Wed Oct 31 11:31:37 2018 +0100
# Node ID 9fb966ffce373f2456aa46a0be16f42d2621fdec
# Parent 3c00344f49c951d5076dd2c4b7a2389603aba66c
Suppress unused typef warnings (#615)
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
a
|
b
|
|
| 148 | 148 | "Default MIP solver backend (GLPK, CPLEX or CBC)") |
| 149 | 149 | ENDIF() |
| 150 | 150 | |
| | 151 | IF( ( ("${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) |
| | 157 | ENDIF() |
| 151 | 158 | |
| 152 | 159 | IF(DEFINED ENV{LEMON_CXX_WARNING}) |
| 153 | 160 | SET(CXX_WARNING $ENV{LEMON_CXX_WARNING}) |
| 154 | 161 | ELSE() |
| 155 | | IF(CMAKE_COMPILER_IS_GNUCXX) |
| | 162 | IF( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
| | 163 | OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
| | 164 | ) |
| 156 | 165 | 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") |
| 157 | 166 | SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") |
| 158 | 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") |
| | 170 | SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") |
| | 171 | SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") |
| 159 | 172 | ELSEIF(MSVC) |
| 160 | 173 | # This part is unnecessary 'casue the same is set by the lemon/core.h. |
| 161 | 174 | # Still kept as an example. |
diff --git a/lemon/bfs.h b/lemon/bfs.h
|
a
|
b
|
|
| 1377 | 1377 | struct SetReachedMapTraits : public Traits { |
| 1378 | 1378 | typedef T ReachedMap; |
| 1379 | 1379 | static ReachedMap *createReachedMap(const Digraph &digraph) { |
| | 1380 | ::lemon::ignore_unused_variable_warning(digraph); |
| 1380 | 1381 | LEMON_ASSERT(false, "ReachedMap is not initialized"); |
| 1381 | 1382 | return 0; // ignore warnings |
| 1382 | 1383 | } |
diff --git a/lemon/concepts/graph_components.h b/lemon/concepts/graph_components.h
|
a
|
b
|
|
| 103 | 103 | _GraphItem i1; |
| 104 | 104 | i1=INVALID; |
| 105 | 105 | _GraphItem i2 = i1; |
| | 106 | ::lemon::ignore_unused_variable_warning(i2); |
| 106 | 107 | _GraphItem i3 = INVALID; |
| 107 | 108 | |
| 108 | 109 | i1 = i2 = i3; |
| … |
… |
|
| 734 | 735 | ++(++it1); |
| 735 | 736 | |
| 736 | 737 | Item bi = it1; |
| | 738 | ::lemon::ignore_unused_variable_warning(bi); |
| 737 | 739 | bi = it2; |
| 738 | 740 | } |
| 739 | 741 | const GR& g; |
| … |
… |
|
| 824 | 826 | ++it2 = it1; |
| 825 | 827 | ++(++it1); |
| 826 | 828 | Item e = it1; |
| | 829 | ::lemon::ignore_unused_variable_warning(e); |
| 827 | 830 | e = it2; |
| 828 | 831 | } |
| 829 | 832 | const Base& node; |
diff --git a/lemon/concepts/path.h b/lemon/concepts/path.h
|
a
|
b
|
|
| 70 | 70 | |
| 71 | 71 | /// \brief Template copy constructor |
| 72 | 72 | template <typename CPath> |
| 73 | | Path(const CPath& cpath) {} |
| | 73 | Path(const CPath& cpath) { |
| | 74 | ::lemon::ignore_unused_variable_warning(cpath); |
| | 75 | } |
| 74 | 76 | |
| 75 | 77 | /// \brief Template assigment operator |
| 76 | 78 | template <typename CPath> |
diff --git a/lemon/config.h.in b/lemon/config.h.in
|
a
|
b
|
|
| 2 | 2 | #define LEMON_CONFIG_H |
| 3 | 3 | |
| 4 | 4 | #define LEMON_VERSION "@PROJECT_VERSION@" |
| | 5 | |
| 5 | 6 | #cmakedefine LEMON_HAVE_LONG_LONG 1 |
| 6 | 7 | |
| 7 | 8 | #cmakedefine LEMON_WIN32 1 |
| … |
… |
|
| 26 | 27 | #cmakedefine LEMON_USE_PTHREAD 1 |
| 27 | 28 | #cmakedefine LEMON_USE_WIN32_THREADS 1 |
| 28 | 29 | |
| | 30 | #cmakedefine LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS 1 |
| | 31 | |
| 29 | 32 | #endif |
diff --git a/lemon/core.h b/lemon/core.h
|
a
|
b
|
|
| 33 | 33 | // C4503: 'function' : decorated name length exceeded, name was truncated |
| 34 | 34 | // C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning) |
| 35 | 35 | // C4996: 'function': was declared deprecated |
| | 36 | |
| | 37 | #include <lemon/config.h> |
| | 38 | |
| 36 | 39 | #ifdef _MSC_VER |
| 37 | 40 | #pragma warning( disable : 4250 4267 4355 4503 4800 4996 ) |
| 38 | 41 | #endif |
| 39 | 42 | |
| 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 |
| 42 | 45 | #pragma GCC diagnostic ignored "-Wunused-local-typedefs" |
| 43 | 46 | #endif |
| 44 | 47 | |
| 45 | 48 | #include <vector> |
| 46 | 49 | #include <algorithm> |
| 47 | 50 | |
| 48 | | #include <lemon/config.h> |
| 49 | 51 | #include <lemon/bits/enable_if.h> |
| 50 | 52 | #include <lemon/bits/traits.h> |
| 51 | 53 | #include <lemon/assert.h> |
diff --git a/lemon/dfs.h b/lemon/dfs.h
|
a
|
b
|
|
| 1319 | 1319 | struct SetReachedMapTraits : public Traits { |
| 1320 | 1320 | typedef T ReachedMap; |
| 1321 | 1321 | static ReachedMap *createReachedMap(const Digraph &digraph) { |
| | 1322 | ::lemon::ignore_unused_variable_warning(digraph); |
| 1322 | 1323 | LEMON_ASSERT(false, "ReachedMap is not initialized"); |
| 1323 | 1324 | return 0; // ignore warnings |
| 1324 | 1325 | } |
diff --git a/lemon/nagamochi_ibaraki.h b/lemon/nagamochi_ibaraki.h
|
a
|
b
|
|
| 175 | 175 | typedef CR HeapCrossRef; |
| 176 | 176 | typedef H Heap; |
| 177 | 177 | static HeapCrossRef *createHeapCrossRef(int num) { |
| | 178 | ::lemon::ignore_unused_variable_warning(num); |
| 178 | 179 | LEMON_ASSERT(false, "HeapCrossRef is not initialized"); |
| 179 | 180 | return 0; // ignore warnings |
| 180 | 181 | } |
diff --git a/test/adaptors_test.cc b/test/adaptors_test.cc
|
a
|
b
|
|
| 145 | 145 | |
| 146 | 146 | // Check the conversion of nodes and arcs |
| 147 | 147 | Digraph::Node nd = n4; |
| | 148 | ::lemon::ignore_unused_variable_warning(nd); |
| 148 | 149 | nd = n4; |
| 149 | 150 | Adaptor::Node na = n1; |
| | 151 | ::lemon::ignore_unused_variable_warning(na); |
| 150 | 152 | na = n2; |
| 151 | 153 | Digraph::Arc ad = a4; |
| | 154 | ::lemon::ignore_unused_variable_warning(ad); |
| 152 | 155 | ad = a5; |
| 153 | 156 | Adaptor::Arc aa = a1; |
| | 157 | ::lemon::ignore_unused_variable_warning(aa); |
| 154 | 158 | aa = a2; |
| 155 | 159 | } |
| 156 | 160 | |
| … |
… |
|
| 269 | 273 | |
| 270 | 274 | // Check the conversion of nodes and arcs |
| 271 | 275 | Digraph::Node nd = n3; |
| | 276 | ::lemon::ignore_unused_variable_warning(nd); |
| 272 | 277 | nd = n3; |
| 273 | 278 | Adaptor::Node na = n1; |
| | 279 | ::lemon::ignore_unused_variable_warning(na); |
| 274 | 280 | na = n2; |
| 275 | 281 | Digraph::Arc ad = a3; |
| | 282 | ::lemon::ignore_unused_variable_warning(ad); |
| 276 | 283 | ad = a3; |
| 277 | 284 | Adaptor::Arc aa = a1; |
| | 285 | ::lemon::ignore_unused_variable_warning(aa); |
| 278 | 286 | aa = a2; |
| 279 | 287 | } |
| 280 | 288 | |
| … |
… |
|
| 365 | 373 | |
| 366 | 374 | // Check the conversion of nodes and arcs |
| 367 | 375 | Digraph::Node nd = n3; |
| | 376 | ::lemon::ignore_unused_variable_warning(nd); |
| 368 | 377 | nd = n3; |
| 369 | 378 | Adaptor::Node na = n1; |
| | 379 | ::lemon::ignore_unused_variable_warning(na); |
| 370 | 380 | na = n2; |
| 371 | 381 | Digraph::Arc ad = a3; |
| | 382 | ::lemon::ignore_unused_variable_warning(ad); |
| 372 | 383 | ad = a3; |
| 373 | 384 | Adaptor::Arc aa = a1; |
| | 385 | ::lemon::ignore_unused_variable_warning(aa); |
| 374 | 386 | aa = a2; |
| 375 | 387 | } |
| 376 | 388 | |
| … |
… |
|
| 463 | 475 | |
| 464 | 476 | // Check the conversion of nodes and arcs |
| 465 | 477 | Digraph::Node nd = n3; |
| | 478 | ::lemon::ignore_unused_variable_warning(nd); |
| 466 | 479 | nd = n3; |
| 467 | 480 | Adaptor::Node na = n1; |
| | 481 | ::lemon::ignore_unused_variable_warning(na); |
| 468 | 482 | na = n2; |
| 469 | 483 | Digraph::Arc ad = a3; |
| | 484 | ::lemon::ignore_unused_variable_warning(ad); |
| 470 | 485 | ad = a3; |
| 471 | 486 | Adaptor::Arc aa = a1; |
| | 487 | ::lemon::ignore_unused_variable_warning(aa); |
| 472 | 488 | aa = a2; |
| 473 | 489 | } |
| 474 | 490 | |
| … |
… |
|
| 574 | 590 | |
| 575 | 591 | // Check the conversion of nodes and arcs/edges |
| 576 | 592 | Digraph::Node nd = n3; |
| | 593 | ::lemon::ignore_unused_variable_warning(nd); |
| 577 | 594 | nd = n3; |
| 578 | 595 | Adaptor::Node na = n1; |
| | 596 | ::lemon::ignore_unused_variable_warning(na); |
| 579 | 597 | na = n2; |
| 580 | 598 | Digraph::Arc ad = e3; |
| | 599 | ::lemon::ignore_unused_variable_warning(ad); |
| 581 | 600 | ad = e3; |
| 582 | 601 | Adaptor::Edge ea = a1; |
| | 602 | ::lemon::ignore_unused_variable_warning(ea); |
| 583 | 603 | ea = a2; |
| 584 | 604 | } |
| 585 | 605 | |
| … |
… |
|
| 734 | 754 | |
| 735 | 755 | // Check the conversion of nodes and arcs |
| 736 | 756 | Digraph::Node nd = Adaptor::NodeIt(adaptor); |
| | 757 | ::lemon::ignore_unused_variable_warning(nd); |
| 737 | 758 | nd = ++Adaptor::NodeIt(adaptor); |
| 738 | 759 | Adaptor::Node na = n1; |
| | 760 | ::lemon::ignore_unused_variable_warning(na); |
| 739 | 761 | na = n2; |
| 740 | 762 | Digraph::Arc ad = Adaptor::ArcIt(adaptor); |
| | 763 | ::lemon::ignore_unused_variable_warning(ad); |
| 741 | 764 | ad = ++Adaptor::ArcIt(adaptor); |
| 742 | 765 | } |
| 743 | 766 | |
| … |
… |
|
| 987 | 1010 | |
| 988 | 1011 | // Check the conversion of nodes and edges |
| 989 | 1012 | Graph::Node ng = n3; |
| | 1013 | ::lemon::ignore_unused_variable_warning(ng); |
| 990 | 1014 | ng = n4; |
| 991 | 1015 | Adaptor::Node na = n1; |
| | 1016 | ::lemon::ignore_unused_variable_warning(na); |
| 992 | 1017 | na = n2; |
| 993 | 1018 | Graph::Edge eg = e3; |
| | 1019 | ::lemon::ignore_unused_variable_warning(eg); |
| 994 | 1020 | eg = e4; |
| 995 | 1021 | Adaptor::Edge ea = e1; |
| | 1022 | ::lemon::ignore_unused_variable_warning(ea); |
| 996 | 1023 | ea = e2; |
| 997 | 1024 | } |
| 998 | 1025 | |
| … |
… |
|
| 1092 | 1119 | |
| 1093 | 1120 | // Check the conversion of nodes and edges |
| 1094 | 1121 | Graph::Node ng = n3; |
| | 1122 | ::lemon::ignore_unused_variable_warning(ng); |
| 1095 | 1123 | ng = n4; |
| 1096 | 1124 | Adaptor::Node na = n1; |
| | 1125 | ::lemon::ignore_unused_variable_warning(na); |
| 1097 | 1126 | na = n2; |
| 1098 | 1127 | Graph::Edge eg = e3; |
| | 1128 | ::lemon::ignore_unused_variable_warning(eg); |
| 1099 | 1129 | eg = e4; |
| 1100 | 1130 | Adaptor::Edge ea = e1; |
| | 1131 | ::lemon::ignore_unused_variable_warning(ea); |
| 1101 | 1132 | ea = e2; |
| 1102 | 1133 | } |
| 1103 | 1134 | |
| … |
… |
|
| 1198 | 1229 | |
| 1199 | 1230 | // Check the conversion of nodes and edges |
| 1200 | 1231 | Graph::Node ng = n3; |
| | 1232 | ::lemon::ignore_unused_variable_warning(ng); |
| 1201 | 1233 | ng = n4; |
| 1202 | 1234 | Adaptor::Node na = n1; |
| | 1235 | ::lemon::ignore_unused_variable_warning(na); |
| 1203 | 1236 | na = n2; |
| 1204 | 1237 | Graph::Edge eg = e3; |
| | 1238 | ::lemon::ignore_unused_variable_warning(eg); |
| 1205 | 1239 | eg = e4; |
| 1206 | 1240 | Adaptor::Edge ea = e1; |
| | 1241 | ::lemon::ignore_unused_variable_warning(ea); |
| 1207 | 1242 | ea = e2; |
| 1208 | 1243 | } |
| 1209 | 1244 | |
| … |
… |
|
| 1356 | 1391 | |
| 1357 | 1392 | // Check the conversion of nodes and arcs/edges |
| 1358 | 1393 | Graph::Node ng = n3; |
| | 1394 | ::lemon::ignore_unused_variable_warning(ng); |
| 1359 | 1395 | ng = n3; |
| 1360 | 1396 | Adaptor::Node na = n1; |
| | 1397 | ::lemon::ignore_unused_variable_warning(na); |
| 1361 | 1398 | na = n2; |
| 1362 | 1399 | Graph::Edge eg = e3; |
| | 1400 | ::lemon::ignore_unused_variable_warning(eg); |
| 1363 | 1401 | eg = e3; |
| 1364 | 1402 | Adaptor::Arc aa = e1; |
| | 1403 | ::lemon::ignore_unused_variable_warning(aa); |
| 1365 | 1404 | aa = e2; |
| 1366 | 1405 | } |
| 1367 | 1406 | |