Skip to content

Commit c35d272

Browse files
committed
Merge branch 'fix-odr-warnings' into 'v100-bugfix'
fix one-definition-rule warnings See merge request integer/scip!4074
2 parents 42967d0 + 672c8ca commit c35d272

27 files changed

+100
-56
lines changed

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,11 @@ if(LTO)
108108
message(STATUS "LTO available")
109109

110110
# with link-time optimization enabled, we get additional warnings at link time on
111-
# - reader_nl and presol_milp violating the C++ One Definition Rule (-Wodr) due to
112-
# using struct names SCIP_ProbData and SCIP_PresolData that are also used in objscip (C++ interface)
113111
# - some presumed malloc() calls with size 18446744073709551608 ((uint)-1)
114112
# - some presumed memmove() calls in boost::container::short_vector via papilo to a 0-length memory
115113
# we disable these warnings (need to pass them to the compiler when linking)
116114
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "CLANG"))
117-
add_link_options(-Wno-odr -Wno-alloc-size-larger-than -Wno-stringop-overflow)
115+
add_link_options(-Wno-alloc-size-larger-than -Wno-stringop-overflow)
118116
endif()
119117
else(LTO_AVAILABLE)
120118
message(STATUS "LTO not available: ${output}")

make/make.darwin.gnu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ ifeq ($(LTO),true)
2929

3030
CFLAGS += $(LTOFLAG) -fno-fat-lto-objects
3131
CXXFLAGS += $(LTOFLAG) -fno-fat-lto-objects
32-
LDFLAGS += $(LTOFLAG) -Wno-stringop-overflow -Wno-alloc-size-larger-than -Wno-odr
32+
LDFLAGS += $(LTOFLAG) -Wno-stringop-overflow -Wno-alloc-size-larger-than
3333
ifeq ($(SHARED),true)
34-
LIBBUILDFLAGS += $(LTOFLAG) -Wno-stringop-overflow -Wno-alloc-size-larger-than -Wno-odr
34+
LIBBUILDFLAGS += $(LTOFLAG) -Wno-stringop-overflow -Wno-alloc-size-larger-than
3535
endif
3636
endif
3737

make/make.linux.gnu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ ifeq ($(LTO),true)
5252

5353
CFLAGS += $(LTOFLAG) -fno-fat-lto-objects
5454
CXXFLAGS += $(LTOFLAG) -fno-fat-lto-objects
55-
LDFLAGS += $(LTOFLAG) -Wno-stringop-overflow -Wno-alloc-size-larger-than -Wno-odr
55+
LDFLAGS += $(LTOFLAG) -Wno-stringop-overflow -Wno-alloc-size-larger-than
5656
ifeq ($(SHARED),true)
57-
LIBBUILDFLAGS += $(LTOFLAG) -Wno-stringop-overflow -Wno-alloc-size-larger-than -Wno-odr
57+
LIBBUILDFLAGS += $(LTOFLAG) -Wno-stringop-overflow -Wno-alloc-size-larger-than
5858
endif
5959
endif

src/scip/benders_xyz.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
* Data structures
5252
*/
5353

54-
/* TODO: fill in the necessary Benders' decomposition data */
54+
/* TODO: fill in the necessary Benders' decomposition data
55+
* when this plugin is written in C++, rename SCIP_BendersData to something unique (C++ One-Definition-Rule)
56+
*/
5557

5658
/** Benders' decomposition data */
5759
struct SCIP_BendersData

src/scip/benderscut_xyz.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
* Data structures
4646
*/
4747

48-
/* TODO: fill in the necessary compression data */
48+
/* TODO: fill in the necessary compression data
49+
* when this plugin is written in C++, rename SCIP_BenderscutData to something unique (C++ One-Definition-Rule)
50+
*/
4951

5052
/** Benders' decomposition cut data */
5153
struct SCIP_BenderscutData

src/scip/branch_xyz.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
* Data structures
4747
*/
4848

49-
/* TODO: fill in the necessary branching rule data */
49+
/* TODO: fill in the necessary branching rule data
50+
* when this plugin is written in C++, rename SCIP_BranchruleData to something unique (C++ One-Definition-Rule)
51+
*/
5052

5153
/** branching rule data */
5254
struct SCIP_BranchruleData

src/scip/compr_xyz.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
* Data structures
4646
*/
4747

48-
/* TODO: fill in the necessary compression data */
48+
/* TODO: fill in the necessary compression data
49+
* when this plugin is written in C++, rename SCIP_ComprData to something unique (C++ One-Definition-Rule)
50+
*/
4951

5052
/** tree compression data */
5153
struct SCIP_ComprData

src/scip/cons_xyz.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@
7373
* Data structures
7474
*/
7575

76-
/* TODO: fill in the necessary constraint data */
76+
/* TODO: fill in the necessary constraint data
77+
* when this plugin is written in C++, rename SCIP_ConsData and SCIP_ConshdlrData to something unique (C++ One-Definition-Rule)
78+
*/
7779

7880
/** constraint data for xyz constraints */
7981
struct SCIP_ConsData

src/scip/cutsel_xyz.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
* Data structures
4545
*/
4646

47-
/* TODO: fill in the necessary cut selector data */
47+
/* TODO: fill in the necessary cut selector data
48+
* when this plugin is written in C++, rename SCIP_CutselData to something unique (C++ One-Definition-Rule)
49+
*/
4850

4951
/** cut selector data */
5052
struct SCIP_CutselData

src/scip/dialog_xyz.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
* Data structures
4747
*/
4848

49-
/* TODO: fill in the necessary dialog data */
49+
/* TODO: fill in the necessary dialog data
50+
* when this plugin is written in C++, rename SCIP_DialogData to something unique (C++ One-Definition-Rule)
51+
*/
5052

5153
/** dialog data */
5254
struct SCIP_DialogData

0 commit comments

Comments
 (0)