Opened 4 years ago
Last modified 4 years ago
#633 new defect
Fixes fox gcc 9
Reported by: | Alpar Juttner | Owned by: | Alpar Juttner |
---|---|---|---|
Priority: | blocker | Milestone: | LEMON 1.4 release |
Component: | core | Version: | hg main |
Keywords: | Cc: | ||
Revision id: |
Description
The gcc 9.x report tons of warnings like
/home/alpar/projects/LEMON/hg/comptest-main/lemon/concepts/graph_components.h:527:15: error: implicitly-declared ‘lemon::concepts::Digraph::Node& lemon::concepts::Digraph::Node::operator=(const lemon::concepts::Digraph::Node&)’ is deprecated [-Werror=deprecated-copy] 527 | node=INVALID; | ~~~~^~~~~~~~ In file included from /home/alpar/projects/LEMON/hg/comptest-main/test/max_flow_test.cc:25: /home/alpar/projects/LEMON/hg/comptest-main/lemon/concepts/digraph.h:78:9: note: because ‘lemon::concepts::Digraph::Node’ has user-provided ‘lemon::concepts::Digraph::Node::Node(const lemon::concepts::Digraph::Node&)’ 78 | Node(const Node&) { } | ^~~~
The patch attached makes an attempt to fix it. Some of the changes, and event some of the related part of the current code is strange even for myself.
So this patch definitely needs a thorough review.
Attachments (1)
Change History (4)
Changed 4 years ago by
Attachment: | fix-gcc9.patch added |
---|
comment:1 Changed 4 years ago by
Priority: | major → blocker |
---|
comment:2 Changed 4 years ago by
comment:3 Changed 4 years ago by
I have put this patch to main branch as [da87dbdf3daf], but leave the ticket open for further discussions.
Note: See
TracTickets for help on using
tickets.
I checked the patch and here are some comments.
NodeMap
public inlemon/concepts/digraph.h
. I checked the tests that require this change, but I think that those tests are actually wrong. As far as I remember,NodeMap
objects cannot be copied with copy constructor and assignment operator, only using the map copy util methods. E.g. indijkstra_test
, the two assignments on L100 and L101 seems to be incorrect requirements: https://lemon.cs.elte.hu/trac/lemon/browser/lemon/test/dijkstra_test.cc?rev=8c567e298d7f3fad82cc66754f2fb6c4a420366b#L100 I would replace them with assignments of (const) references. And similarly in similar test files.RangeMap
.